Solved

Configure network settings for Virtual Box Ubuntu Server 12.04 guest

Posted on 2013-11-20
10
1,685 Views
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.

Thanks,
Cali
0
Comment
Question by:tancat
  • 4
  • 4
  • 2
10 Comments
 
LVL 8

Accepted Solution

by:
subhashchy earned 250 total points
Comment Utility
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.
0
 
LVL 61

Expert Comment

by:gheist
Comment Utility
You need to use bridged network and configure ip settings in /etc/network/interfaces
0
 

Author Comment

by:tancat
Comment Utility
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).  

Thanks!
0
 
LVL 61

Assisted Solution

by:gheist
gheist earned 250 total points
Comment Utility
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?
0
 

Author Comment

by:tancat
Comment Utility
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.
0
Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

 
LVL 8

Expert Comment

by:subhashchy
Comment Utility
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..
0
 

Author Closing Comment

by:tancat
Comment Utility
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!
0
 
LVL 61

Expert Comment

by:gheist
Comment Utility
Even easier - you can do svnadmin create C:\XYZ\ from tortoisesvn and then point SubClipse to file:////c:/XYZ/
0
 

Author Comment

by:tancat
Comment Utility
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.

http://bitnami.com/stack/subversion/virtual-machine
0
 
LVL 61

Expert Comment

by:gheist
Comment Utility
1) you dont need it
2) you really dont need it
3) you can run apache or svnserve on windows
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

VM backups can be lost due to a number of reasons: accidental backup deletion, backup file corruption, disk failure, lost or stolen hardware, malicious attack, or due to some other undesired and unpredicted event. Thus, having more than one copy of …
VM backup deduplication is a method of reducing the amount of storage space needed to save VM backups. In most organizations, VMs contain many duplicate copies of data, such as VMs deployed from the same template, VMs with the same OS, or VMs that h…
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…

763 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

Need Help in Real-Time?

Connect with top rated Experts

6 Experts available now in Live!

Get 1:1 Help Now