I have bought my TLD domain, say domain.com. What I'd like to do is to host the website available under this address on my own computer. I'm assigned a dynamic IP, and I'm also behind a router in my local network. I'd run sites on my ubuntu server on a virtualbox machine which is available in my local network.
Preferably, I'd like to have my own domain on some server, with which I could experiment as much as I need (so it's only for educational purposes), but I can't afford to buy such a service.
Is it feasible? Can you provide steps I'd need to take to configure it (could be just general explanation). I'd need some guidance, please.
I run a very similar set up. The secret to running a server on a VM, is to stop thinking of it as a VM. I'm currently using my own domain name, and zoneedit to manage my domain names, with a fairly custom hackish dynamic dns script (my ISP has some wierd transparent proxy that totally messes with most dynamic dns clients - i scrape my ip address off the router, and pass it on to zoneedit). They have clients for that, and the advantage is you can use your own domain name at no cost.
DMZ isn't the best solution - open up and forward ports to the VM at the router as needed. Its more secure.
virtualhosts arn't an issue except for web hosting - you do it the same way you would do it for any system - point the domain names at the server ip, and the rest is handled at the application level.
With a setup like yours, you'll need :
Regarding the dynamic dns, I see two solutions :
I recommend sticking to the second solution from petrus, since it is the easiest in your case.
It does not stop you from using virtual hosts because you can set as many CNAME entries to point to your single dynamic dns entry. If your DNS host allows wildcard entries, you can serve every sub-domain off your home server, with only configuration of virtual hosts in your webserver.
Another important part of the equation is getting your Virtualbox servers accessed from the outside. You will need to make sure that your router can talk to your VM. This may involve bridging your VM network interface to the host machine's LAN interface, that is connected to the router.
Just need to be careful with the networking part. It catches some people.