I'm using MAMP to host my local sites, and VirtualHostX so that I can access sites during local development via a convenient URL like mysite.dev

I'm also running Windows XP via VirtualBox, and it would be great to be able to load up any of my local sites within windows while offline as currently often working without access, on the move, unfortunately.

I know that I can append my IP and a nice domain name to the host file in C:/WINDOWS/system32/drivers/etc ... and i can find my IP simply through terminal with "ifconfig" while I'm online.

The problem is that when I'm not online, there's no IP. Even if there is an IP (when i have a connection), I still have grab it and update the windows hosts' file all the time, since I'm developing from a laptop and have a new IP at the drop of a dime.

I found a tutorial where the author is able to get a permanent IP. He uses VMware Fusion as his VMachine, which is the only difference between his setup and mine. By running the terminal command "ifconfig vmnet1" he gets:

a secret IP the virtual machine uses to talk to OSX

And that doesn't change - which is awesome. I'm assuming it exists even if he's offline.

It would be pretty fabulous if I could replicate this with VirtualBox.

Anyone have ideas?


You can do a similar thing if you're running VirtualBox

Run ifconfig and get a list of available interfaces (with VBox active) My list had an interface named 'vboxnet0' and an ipv6 address

Throw the address into your hosts file in the Win VM and you should be right to go

Your Answer

By clicking "Post Your Answer", you agree to our terms of service, privacy policy and cookie policy

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