Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

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 http://192.168.56.101/dokuwiki/doku.php 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

192.168.56.101 userver

with the idea of using http://userver/dokuwiki/doku.php to access my site. Even http://192.168.56.101/dokuwiki/doku.php 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 http://192.168.56.101/dokuwiki/doku.php or http://userver/dokuwiki/doku.php. Once I connect to the web using my USB dongle(I use wvdial) the wiki becomes inaccessible.

share|improve this question
    
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: 192.168.56.101 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

1 Answer 1

up vote 0 down vote accepted

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.
share|improve this answer
    
I have enabled this. –  Chethan S. Jan 22 '12 at 15:30

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.