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.

I have virtualbox running on a Windows 2008 server, with a guest running ubuntu 10.04. The ubuntu guest is given a static IP of 192.168.1.4, which also has openssh installed. The guest has bridged network setup, I can ping 192.168.1.4 from any machine in the LAN, the ubuntu guest can also access the LAN. However, when I try to PuTTY into the ubuntu machine, I always get "connection refused". Below are some setup details:

ubuntu IP: 192.168.1.4

hosts.allow

sshd : 192.168.1.38

hosts.deny

ALL : ALL

when I the following command, I can see that sshd is listening on port 22:

lsof -i tcp:22

Any idea?

EDIT:

It turned out to be a wrong VirtualBox Bridged Network setup. I give the Ubuntu guest a static IP of 192.168.1.4 (assigned to eth0). Then in the Windows 7 host, in the Network and Sharing Center, there is a new connection named "VirtualBox Host-Only Network" after the bridge is setup, that connection is again given the same static IP of 192.168.1.4. Once I change the "VirtualBox Host-Only Network" to automatically obtain an IP address, it's getting a different IP address of 169.254.249.70(Tentative). And now I can SSH into 192.168.1.4 with no problem, even without touching hosts.allow and hosts.deny.

I've also noticed that in the properties windows (see screenshot below) of the "VirtualBox Host-Only Network", the second checkbox, "VirtualBox Bridged Networking Driver" is unchecked. While the same checkbox of the physical NIC (that is bridged to) is checked. So my further question is: is this how VBox bridged networking supposed to be setup? Any rationale behind this? I'd appreciate if someone could provide some explaination on VBox bridged networking setup on Windows host and I'll accept it as an answer.

VirtualBox Host-Only Network Properties

share|improve this question
    
What network config is Vbox using? –  Amith KK Feb 8 '12 at 6:20
    
Have you check firewall? –  Carlos Fernández San Millán Feb 8 '12 at 6:23
    
Is there a firewall / windows firewall on the host machine installed / enabled? I am not sure where in the driver stack the network bridge is settled and whether it completely bypasses the firewalls on the host computer. Can you access the virtual ubuntu machine directly from the host pc? –  Michael K Feb 8 '12 at 6:24
    
for VirtualBox and its network to work properly both vboxdrv vboxnetflt modules must be running. Can you confirm it? –  Carlos Fernández San Millán Feb 8 '12 at 6:29
2  
If you are in a laptop check which adapter you have chosen as default and which you are using in windows. For example, if you are on a desktop without wifi, then you should choose eth0 by default in VBox. If you are on a wireless connection, make sure you have selected wlan0. –  Carlos Fernández San Millán Feb 8 '12 at 7:17

2 Answers 2

I have a Windows 7 host, Ubuntu 12.04 guest, Virtual Box.

My host get the IP from a router via wireless, choose network adapter options (running Ubuntu ) and select ''Attached to bridge adapter -> Name: < the name of your connection adapter (it can be your wireless or network adapter) >.

Disconnect the ''wired connection'' from Ubuntu and set as DCHP client (automatic DHCP) in edit connections ipv4.

Now you get an Ip assigned by your router and you can test making ping between host -> guest and guest -> host.

share|improve this answer

Here's a similar situation and what I did to resolve. I had my network settings set to NAT, which resulted in my guest not using the hosts network adapter. The ip was set and then I found out later:

Search for:

I've installed BigBlueButton using the VM, but I can't access it from a browser

On this page:
http://code.google.com/p/bigbluebutton/wiki/FAQ

Even though I switched I needed to refresh my guest network adapter to pick up a new ip address, use the commmand ifconfig in the guest to find out what IP its using and set bbb-conf setip to that ip address result from ifconfig. The guest will use the host's adapter to get out to the web/network.

For a Putty connection, run this command on your guest: sudo apt-get install openssh-server

Run Putty with the ip from above (ifconfig result) with port 22.

Here is a good read on host-only networking:
http://christophermaier.name/blog/2010/09/01/host-only-networking-with-virtualbox

share|improve this answer

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.