Configure network settings for Virtual Box Ubuntu Server 12.04 guest

Posted on 2013-11-20
Last Modified: 2013-12-18
I am brand new to working with servers and networking and seem to be missing something in my understanding of the network config.  (My background is oracle development.)

I have a windows 7 pc upon which I have installed VirtualBox 4.2.18.  I have installed a guest machine, using Ubuntu Server 12.04 64-bit, and installed OpensshServer.  I did not enter http_proxy information (don't know quite what that is yet).  My intention is to install SVN for the purpose of learning, and eventually to give a demonstration for an evaluation at my company.  I just need to be able to reach the virtual machine from my pc, as though I were checking in/out files.  

I cannot figure out how to configure the network adapter(s) for the virtual machine so that I can reach the guest as though it were an SVN server.  I have tried NAT (with and without port forwarding - not that I really understand port forwarding), Host-only, and Bridged.  It seems that I can only ping the host from the guest, or vice versa, or I cannot get my windows host to find the guest when I use the hostname (svnserver).  I'd like not to have to use a static IP (I did actually get this to work using the hostname).  

I need to increase my understanding of how VirtualBox handles the network configurations, or someone to just tell me how to set it up, with some explanation.

Question by:tancat
  • 4
  • 4
  • 2

Accepted Solution

subhashchy earned 250 total points
ID: 39664443
You have not provided whether you have a DHCP and DNS setup or not (In home network i would take a NO for this). Also Whether you have an external Network providing IP address to your windows network card or not.

so from the question what i get is -

1. you want to setup your Vbox guest as a SVN server,
2. Further you want to access it from your laptop using hostname NOT IP Address.

 if that is correct, here is what i would do,  

1. In the VBOX settings for the Guest, Use host only networking.
2. That will install a virtual network card on the host (Windows 7) system.
3. Note the IP Address of this adapter. Virtual BOX DHCP should have given it one. If it does not have one assign an IP (In the range you prefer)

4. Login to your linux Guest and check the IP of the adapter. IF the IP is in the same range as the one you noted in above step, Try to ping the Host IP you just noted in step 3.

5. If ping works, Try the ping other way . From Host to guest. Should work fine.

6. Now on your host machine (windows 7) edit your hosts file and add an entry for the linux machine.

Vista and Windows 7 use User Account Control (UAC) so Notepad must be run as Administrator.
A. Click Start -> All Programs -> Accessories
b. Right click Notepad and select Run as administrator

c. Click Continue on the "Windows needs your permission" UAC window.

d. When Notepad opens Click File -> Open

e. In the filename field type C:\Windows\System32\Drivers\etc\hosts

f. Click Open

Open in new window

By adding entry I mean - append a line at the end .

192.168.x.x svnservername

Open in new window

Where 192.168.x.x is the IP of your guest machine.

Save the file and try to ping the guest machine using the name.

Let me know if you get stuck.
LVL 62

Expert Comment

ID: 39665421
You need to use bridged network and configure ip settings in /etc/network/interfaces

Author Comment

ID: 39666875
Your statements,
     1. you want to setup your Vbox guest as a SVN server,
     2. Further you want to access it from your laptop using hostname NOT IP Address.
are correct - that is exactly what I want to do.

However, I'd like to do it without setting a static IP.  Maybe this isn't possible?  

I was able to get it to work while setting a static IP (in the interfaces file, hosts file, etc), but not while letting the Virtual BOX DHCP "choose" a different IP each time.  

Unfortunately I am in meetings the rest of today, so I'll have to try this tonight.  Let me confirm that I am able to make it work with a static IP and also figure out why I didn't want to do that (I think something down the line gave me a problem, but I can't remember now what it was).  

Back Up Your Microsoft Windows Server®

Back up all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

LVL 62

Assisted Solution

gheist earned 250 total points
ID: 39667109
virtualbox dhcp network is isolated from the internet.
You can forward single port and connect to it.
Most SVN clients support local repositories so why go the leap via virtualisation?

Author Comment

ID: 39675208
I'm sorry, I didn't get a chance to get back to this for very long, and the relatives arrive this afternoon for Thanksgiving, so my ability to work on this this week will be somewhat spotty.  I'll try for next weekend.

Expert Comment

ID: 39675394
well, the issue with DHCP will be that there will be no one to tell your client who that names means (In terms of Name to IP translation). Since DHCP does from Virtualbox or any hyper-visor of that sort does not function as DNS , the trouble is bound to happen.

Or you can have a reservation in the Vbox DHCP for the Guest and that will work out..

Author Closing Comment

ID: 39709995
Thanks, guys; sorry for the delay in communication.  Work and family both got busy.  Also, I realized that I actually asked two questions here, so I asked the moderators if I could split this into two questions for 500 each but they said I couldn't do that.  So I split the points between you.  

gheist solved my initial problem that sent me down this path; I didn't realize that I could install SVN on my pc and create a local repository which works fine for a single developer and for demonstration.

subhashchy solved my network issue, which I needed to understand not just for this issue but also for another project that I'm working on.  I did not realize that the VBox DHCP and the ubuntu server each had a different IP, and I had the VBox DHCP IP in the hosts file.  

Thank you!
LVL 62

Expert Comment

ID: 39710202
Even easier - you can do svnadmin create C:\XYZ\ from tortoisesvn and then point SubClipse to file:////c:/XYZ/

Author Comment

ID: 39727308
Just an additional comment on this issue - Bitnami created a Subversion VM that will run on VirtualBox using a linux OS, which would eliminate much of the manual setup I was doing.
LVL 62

Expert Comment

ID: 39727636
1) you dont need it
2) you really dont need it
3) you can run apache or svnserve on windows

Featured Post

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Vcenter server 5.5 Essentials 16 78
WebSite Direction 1 54
Why does Hype-V Initial Replication Fail? 2 33
Exchange Server DAG mailbox server VMware network configuration 7 38
If your vDisk VHD file gets deleted from the image store accidentally or on purpose, you won't be able to remove the vDisk from the PVS console. There is a known workaround that is solid.
Giving access to ESXi shell console is always an issue for IT departments to other Teams, or Projects. We need to find a way so that teams can use ESXTOP for their POCs, or tests without giving them the access to ESXi host shell console with a root …
How to install and configure Citrix XenApp 6.5 - Part 1. In this video tutorial we have explained step by step installation of Citrix XenApp 6.5 Server on Windows Server 2008 R2 is explained in this video. We have explained the difference between…
In this video tutorial I show you the main steps to install and configure  a VMware ESXi6.0 server. The video has my comments as text on the screen and you can pause anytime when needed. Hope this will be helpful. Verify that your hardware and BIO…

830 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question