Wanted to add quick note about VLANs, VirtualBox, and Ubuntu.
Virtualbox does VLANs a little differently on Ubuntu than other hypervisors. In order to get a VLANs working for a Virtualbox VM, you have to create a subinterface that is for a specific VLAN (of course, assuming your NIC supports 802.1q tagging). To create a subinterface in Ubuntu, follow the instructions here:
Then in Virtualbox, you set the network interface to ‘bridged mode’, then select the subinterface. Assuming your new subinterface is permanent, the VM will use that subinterface and be within that VLAN.
I’m not entirely sure how to accomplish this for Virtualbox on Windows. It would seem like you would need a separate physical interface, especially for Windows 10 and probably others.
Unrelated note: Virtualbox on Windows 10 is horrible, and so is the native Hyper-V, but that’s for another post, maybe.
Edit (20180705): A few years later, and I can honestly say VirtualBox on Windows 10 is stable now, and has been for awhile. Felt the need to update this. :-p