How To SSH From Host (Win7) to Guest (Ubuntu Server 10.04)

5,831

You need to find what IP the guest is using.

If it's using Bridged networking, then it will have gotten an IP from your router and be on your network like any other device. [edit to add: bear in mind if you have no DHCP on your network, you'll have to handle the IP assignment yourself]

If it's using NAT, VirtualBox runs a dhcpd and assigns the guest an internal address. The host should still be able to see this internal IP (but no other box on your network can).

In a Terminal on your guest, run ifconfig and try ssh to the IP shown for eth0 from your host.

Share:
5,831

Related videos on Youtube

Sorin-Mihai Oprea
Author by

Sorin-Mihai Oprea

Updated on September 18, 2022

Comments

  • Sorin-Mihai Oprea
    Sorin-Mihai Oprea over 1 year

    I have recently installed Ubuntu Server 10.04 LTS on my machine that has Windows 7 Ultimate. I would like to run the VM graphicless and access it through ssh from Windows 7. My machine is connected to a router wirelessly and with DHCP. I tried different combinations (NAT/Bridged) but still I am unable to access the guest with PuTTY. It either says connection refused or it simply hangs without anyh other output. While I try to connect to the ssh daemon my VM is started and I am logged in with a normal user.

    My Ubuntu Setup was just installed and I haven't configured anything on it except done an apt-get update && apt-get upgrade

    Also the open-ssh daemon is started and running.

    I don't have ICS on my Windows machine so normally nothing should interfere with the ports. I try to connect to 127.0.0.1:22 with the normal user name for the Ubuntu setup and it won't connect!

    • Marc-André Appel
      Marc-André Appel about 12 years
      Put your VM in Bridged mode, check with ifconfig the assigned IP address of your VM and then try again to SSH to that assigned IP.
  • Sorin-Mihai Oprea
    Sorin-Mihai Oprea about 12 years
    It won't show me an address if I type ifconfig -a It only shows the loopback interface with the address 127.0.0.1 and the eth1 without any address at all. It just says Broadcast Multicast
  • Sorin-Mihai Oprea
    Sorin-Mihai Oprea about 12 years
    One note here: I needed to assign a static IP address to the bridged network! Thank You!
  • Caesium
    Caesium about 12 years
    updated answer with a note that you might have to set IP manually for the benefit of any future visitors :) Glad you got it working!