简体   繁体   中英

setting up localhost for virtual box on a mac

I have a mac running OS X Yosemite. I installed several versions of windows using virtual box. I enter in localhost (I am using xampp only for development purposes [no virtual hosts]) in internet explorer in virtual box and it does a bing search. How do I get localhost to work inside virtual box. Many people have asked about this regarding lunix and other operating systems, but I haven't yet found out how to do this on a mac. Thank you!

To sum it up:

http://localhost

is not loading inside the virtual operating systems in virtual box

This page covers the virtualbox networking quite well.

NAT - Your host will act as a router (firewall) and your hosts will be on a private subnet. Use this if you are not running servers on the guests.

Bridged - Your guests will get a ip address on the same subnet as your host. Use this if you are running servers on the guest and wish to connect from other computers on the LAN.

Host Only - Sort of a hybrid. As the name implies, with this option you can connect to the guest servers from the host only. Use this for "private" (host only) servers. I use this if I am running a test web server.

To make a long story short, assuming you have a router, I would use bridged networking .

I am also on a mac (10.9.5, running VirtualBox version 4.3). I tried to set up Host-only Networks (I'm following a Cassandra tutorial). It gave me this error:

Failed to create the host network interface.

VBoxNetAdpCtl: Error while adding new interface: failed to open /dev/vboxnetctl: No such file or directory.

Result Code: NS_ERROR_FAILURE (0x80004005) Component: HostNetworkInterface Interface: IHostNetworkInterface {f6e556f9-d598-409b-898c-8ba99d9b05ae}

But I was able to get it to create a NAT Network.

This comment from this https://stackoverflow.com/questions/18149546/vagrant-up-failed-dev-vboxnetctl-no-such-file-or-directory solution worked, though:

sudo "/Library/Application Support/VirtualBox/LaunchDaemons/VirtualBoxStartup.sh" restart

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM