Tell me more ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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?

share|improve this question
Could someone enlighten me as to why I'm getting a downvote? It may be a beginner question, but I am a beginner with VirtualBox and I had to google a fair bit to get to the answer, which is: VBoxManage modifyvm "NameOfVM" --natnet1 "192.168/16" – RelaXNow Mar 8 '12 at 13:43
Then post that as the answer, and you can accept it – ekaj Mar 8 '12 at 13:44
I can't, not enough rep, have to wait a day... if you could post it I could accept and the next guy will have an easier time :). – RelaXNow Mar 8 '12 at 13:46
2  
It's a tradeoff...encouraging feedback through voting, or require reasons and questions don't get downvotes. Personally I think it's a little rude not to leave a reason, as it doesn't enlighten users to better hone question skills or ask questions appropriate to the community, but that's my opinion. – Bart Silverstrim Mar 8 '12 at 14:14
1  
May be those who downvoted were questioning the fact this DHCP address was conflicting with your intranet assuming there should be no routing but NAT between the latter and the internal network used by VirtualBox. – jlliagre Mar 8 '12 at 15:00
show 4 more comments

migrated from serverfault.com Mar 8 '12 at 15:46

4 Answers

up vote 6 down vote accepted

Thanks to RelaXNow, here is the answer to the question:

VBoxManage modifyvm  "NameOfVM" --natnet1 "192.168/16" 
share|improve this answer

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.

enter image description here

share|improve this answer
Good answer thanks for the pic, I read the doc too, but I kept going to the specific machine settings not the "general" settings! – SSH This Jan 18 at 17:50

Yes it can be changed. There is documentation on it here:

http://www.virtualbox.org/manual/ch08.html#vboxmanage-dhcpserver

It's handled through the VBoxManage dhcpserver command.

share|improve this answer

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"
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.