I am sure you have arrived in this post, looking for the way to create VLAN in Oracle VirtualBox. You are in the right place. But the thing is, if you need to create a real VLAN, your switch port should have been tagged to 802.1Q VLAN tagging. Then network interface in the OS you are running within VirtualBox should be configured to have 802.1Q VLAN. There is nothing special in the general VirtualBox configuration other than assigning the “Bridge Network”.
But, if you want to simulate the purpose of VLAN when you do not have a switch tagged with 802.1Q VLAN, you can do it with Oracle VirtualBox. That would give you the private access within your VirtualBoxes. Same like many other Vms, Oracle virtual box also supports creating a Virtual LAN. To do this first we need to understand the different types of network types in Virtual Box.
- Not Attached
- Network Address Translation (NAT)
- NAT Network
- Bridge Network
- Internal Network
- Host Only Network
- Generic Network
I do not want to repeat the details of all about network types. If you are concern about it, please refer to this link ==>> (6.2. Introduction to networking modes)
Each different types os networking methods can be used to achieve different kinds of tasks. In our case, we would use “Internal Network”. This will help us create private Virtual LANs by names which would work similar to VLAN and stay communicating in private.
- Go to settings, Click on “network” tab
- Click on “Enable Network Adapter” in one of the adapter tab.
- In “Attached to” select box, choose “Internal Network”
- For the name input box, provide a VLAN name if you do not have already one. It is your choice.
The below screenshot will describe you more.
Now you are done. After you have installed the OS, your will have an interface in your OS, which has a private IP that can only communicate within the same network. With this types of network, even the host computer doesn’t have access to guest. So you stay private and safe.
If you need more detailed guide on setting up a Virtual Network using Oracle VirtualBox, please go to my latest blog post here, Setting up a local network using VirtualBox – Linux – Windows