I have a VirtualBox (v4.1.8) VM that is automatically assigned with an IP in the
10.0.x.x range via DHCP.
Can I change it to use the
192.168.x.x range instead?
Super User is a question and answer site for computer enthusiasts and power users. It only takes a minute to sign up.Sign up to join this community
Providing I have understood the question, if you check chapter 6 of the manual it says:
In the VirtualBox graphical user interface, you can configure all these items in the global settings via "File" -> "Settings" -> "Network", which lists all host-only networks which are presently in use. Click on the network name and then on the "Edit" button to the right, and you can modify the adapter and DHCP settings.
Yes it can be changed. There is documentation on it here:
It's handled through the
VBoxManage dhcpserver command.
You usually don't need to modify VirtualBox DHCP address range. This network is internal and only exists between your VM and the VirtualBox application. There is no routing involved but just NAT.
Should you want to allow accessing your virtual machine from the outside while staying in the default NAT mode, it is possible to selectively open ports (port forwarding).
For example, to allow access to your internal ssh server through the 2022 port, use this command:
VBoxManage modifyvm "NameOfVM" --natpf1 "guestssh,tcp,,2022,,22"