Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

So, on my MacBook I have installed VirtualBox because I want to develop a web app that will be running on FreeBSD OS.

I have installed FreeBSD 8.2 inside virtual PC I have created in VirtualBox. I have logged in as root and installed Apache by running:

portsnap fetch
portsnap extract
portsnap update
cd /usr/ports/www/apache22
make config
make 
make install

I have then added apache22_enable="YES" to /etc/rc.conf and accf_http_load="YES" to /boot/loader.conf. I have rebooted the FreeBSD OS and then restarted Apache just to make sure it works:

/usr/local/sbin/apachectl restart

No errors, Apache is running fine.

Now, what I want to do, is to open the document rot of the Apache in FreeBSD virtual PC in VirtualBox in my host machine which is MacBook OS. I type:

ifconfig

Copy the IP address and paste it into Google Chrome. And it isn't working, after long loading the connection times out. What am I doing wrong?

share|improve this question
    
I am pretty sure I have seem similar questions before. Basically you have to change the virtual NIC settings because in the default NAT mode, the host computer is not on the subnet used by the guests. See: superuser.com/search?q=virtual+box+connect+to+guest –  billc.cn Jan 21 '12 at 16:19

1 Answer 1

By default, VirtualBox networking puts the guest system on its own network, which NATs out to the primary interface of the host system. The host network cannot reach individual IPs on the guest network. You can change this behavior. See my other answer here for more information on how to change the networking model so that they are on the same network.

I would have suggested VirtualBox's "shared folders" feature, but it's currently not supported for FreeBSD guests.

Also, a minor note on your portsnap setup: portsnap extract downloads the most recent ports tree snapshot, so portsnap update is not necessary immediately thereafter. You'll run portsnap update later (or from cron) to keep the tree up to date over time, of course.

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.