Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17


Configure network settings for Virtual Box Ubuntu Server 12.04 guest

Posted on 2013-11-20
Medium Priority
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
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 4
  • 2

Accepted Solution

subhashchy earned 1000 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).  

U.S. Department of Agriculture and Acronis Access

With the new era of mobile computing, smartphones and tablets, wireless communications and cloud services, the USDA sought to take advantage of a mobilized workforce and the blurring lines between personal and corporate computing resources.

LVL 62

Assisted Solution

gheist earned 1000 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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

This is an issue that we can get adding / removing permissions in the vCSA 6.0. We can also have issues searching for users / groups in the AD (using your identify sources). This is how one of the ways to handle this issues and fix it.
In this article, I am going to show you how to simulate a multi-site Lab environment on a single Hyper-V host. I use this method successfully in my own lab to simulate three fully routed global AD Sites on a Windows 10 Hyper-V host.
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…
Video by: ITPro.TV
In this episode Don builds upon the troubleshooting techniques by demonstrating how to properly monitor a vSphere deployment to detect problems before they occur. He begins the show using tools found within the vSphere suite as ends the show demonst…

688 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