How to change local IP to domain name so a host can access a VM?
15,920
Very easy to do, find your Windows 7 hosts file and put an entry in it. The Windows 7 system will now be able to resolve the name to the IP. I'm running a similar dev environment as to what you're describing. Windows 7 Host running Virtual Box with an Ubuntu server VM.
Windows\System32\Drivers\etc\hosts
Add a line as follows
92.168.56.101 www.example.dev
Author by
melanie
Updated on September 18, 2022Comments
-
melanie over 1 year
I've managed to set up a Debian server (in a VM) and now I can access it in the Windows 7 host at
192.168.56.101
Is there any way to "map" that IP to a domain name? It doesn't have to be accessible from the internet, just from the host. Because it's annoying to type the IP in the browser every time I want to access it.
-
Kruug almost 11 yearsHave you tried connecting via \\<vm name>?
-
Ignacio Vazquez-Abrams almost 11 yearsAre you running
nmbd
in the guest? -
melanie almost 11 yearsI'm sorry I don't know what's that :) How do I check if I am?
-
jason almost 11 yearsWhat do you mean "access/map?" You mentioned you are using a browser, are you trying to connect to a Web server you have installed?
-
melanie almost 11 yearsYes. It's apache running on debian, which is running in virtualbox, under windows 7
-
Fiasco Labs almost 11 yearsPut an entry into your hosts file that has the desired host name pointed at the ip.
-
melanie almost 11 yearsin
/etc/hosts
?
-