Virtualbox is one of my favourite OpenSource project, and I am actively following it’s rapid development, headed by Sun/Oracle.
You can use it very easily, and there are tons of howto out of here on how to setup, configure and run your favorite operating system inside another.
The default settings put on your virtual machine a single NAT device, which is good if you only need to reach Internet inside the VM, but it became pretty unusable if you need to access to the VM from an external machine. Here came in help the bridged networking mode, so your VM will get an IP address directly from the DHCP of your current network (both wired or wireless), so you can connect to the VM from everywhere, as you can with the host machine. This is the most flexible environment.
If you want to stay more secure (and probably gain some transfer speed), you can use the host only network: it’s a network managed with dhcp by virtualbox, and it’s only accessible from your host machine (it has a dedicated virtual interface).
Sharing files with the host machine:
- If you need to access to your music collection inside the VM, the best way is to activate the file sharing function of your mac inside System Preferences, and after mount it inside the VM using both command line:
mount -t cifs -o username=yourusername,password=yourpassword,uid=1000,gid=1000 //name.of.the.host.machine/yourusername /mnt/here
- If you need to export a directory from the VM to the host (for me, it's the /var/www, so I don't need to ftp/rsync files when doing web-development), the fastest way is to setup a nfs server and mount it on mac. Apt-get nfs-kernel-server and edit /etc/exports with: