Recently I set up a Dokuwiki installation on Ubuntu Server in VirtualBox. My host OS is Ubuntu 11.10. Till date I was using NAT configuration for my VirtualBox. Since today I decided to use Host-only networking as I did not want the wiki access to outside world. When I was using the NAT method I could access my wiki with this URL: http://localhost:8080/dokuwiki/doku.php. However after I switched to host-only way I am not able to do it.

After seeing instructions elsewhere I realized that using helps but it did not help me. As instructed here, How can I access Apache (on VirtualBox guest) from host? I tried adding following line to my hosts file userver

with the idea of using http://userver/dokuwiki/doku.php to access my site. Even did not work. So can anyone help me on how can I go about this?

Accessing with IP address in the URL would be OK, but I would like to know how I can set custom domain name for use.

Update: As suggested by R.K. I restarted both virtual and physical machines. Then I observed that before connecting to Internet the wiki is accessible with or http://userver/dokuwiki/doku.php. Once I connect to the web using my USB dongle(I use wvdial) the wiki becomes inaccessible.

  • Have you checked the IP on your virtual machine? It may have changed. – R.K. Jan 22 '12 at 15:27
  • I have checked IP using ipconfig on virtual machine. It shows inet addr: under eth0 – Chethan S. Jan 22 '12 at 15:29
  • After seeing instructions elsewhere> Got a link to the instructions? So you changed the port from 8080 to 80? – R.K. Jan 22 '12 at 15:41
  • No, while using NAT I had to use port-forwarding and hence 8080 was used. After switching to host-only this step was not necessary. – Chethan S. Jan 22 '12 at 15:44
  • Intriguing. Have you tried restarting the host or the virtual machine or both? – R.K. Jan 22 '12 at 15:58

You'd have to set the virtual machine's IP manually or activate VB's dhcp server. From the documentation:

For host-only networking, like with internal networking, you may find the DHCP
server useful that is built into VirtualBox. This can be enabled to then 
manage the IP addresses in the host-only network since otherwise you would 
need to configure all IP addresses statically.
| improve this answer | |
  • I have enabled this. – Chethan S. Jan 22 '12 at 15:30

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.