VMWare Server: Connecting to Guest via SSH

I have recently been playing around with an old laptop and it’s give me the taste for delving deeper into the world of Linux. For this I normally use VirtualBox, but a friend of mine (who is an avid Mac fan) was recently raving about VMWare’s Fusion. I decided to see if they had anything similar for linux and give it a whirl. I toddled along to the VMWare site, couldn’t find anything, so Googled VMWare Server and went straight to the relevant page!

I downloaded, installed and connected to the VMWare Server admin via Firefox. All well and good. So now I wanted to actually use it. I decided to test it out using Debian as the Guest. I chose Debian simply because I know it, and I know it has a net install, meaning I could test out a minimum system.

I downloaded the ISO, and then set about creating my new Debian Guest. First problem, I couldn’t find the Debian ISO! After reading the docs (which always takes second place to proding and poking around) it turns out that you need to add a Data Store, using the Commands menu on the right hand side of the VMWare admin home.

Once I had sorted this out I then created the new Guest specifying NAT networking, attached the Debian ISO and started it up.I selected NAT networking because Host Only will not let me get access to the outside world from the guest – obviously a pain as I was using the Debian net install – and I have always found Bridge Networking to be as flaky as a delicious if not slightly dry Cadbury’s chocolate bar.

Hmm, VMWare is clearly very different to VirtualBox because it didnt open a window where I could see the new guest booting up. How do I communicate with the guest. Again, after some poking I found a tab for the Console, which at first asked me to install a Firefox plugin, but once that was installed I could see the Guest.

I then installed Debian and restarted the Guest server.

Once rebooting I then tried to install OpenSSH. Slight problem, I couldn’t get an outside line! I couldn’t even ping Google. Hmm. After some searching I found out that the problem was DHCP was not starting up. I ran the command (as root)

$ dhclient eth0

This allowed me to connect to the outside world, and to ensure it would always start up I followed the commands from this post within Debian Help:

Add the line

auto eth0

to /etc/network/interfaces

After this I managed to successfully install Open SSH server, by running the following command as root:

apt-get install openssh-server

So now it was already to I tried to connect via SSH from my Host Ubuntu system to my Guest Debian system. But how? Again, after some searching I found out that you had to forward some ports. On the host, edit /etc/vmware/vmnet8/nat/nat.conf. Uncomment the line under the SSH section that says:

# 8889 = 172.16.81.128:22

the restart the VMWare networking services:

sudo /usr/lib/vmware/net-services.sh restart

You can see from the nat.conf file that you can also forward other ports such as Web and FTP

Finally, you can now connect to your Guest from your Host with the command:

ssh -p 8889 root@localhost

It took some effort, but I can now successfully connect to any number of Guests from my Host.

  • http://www.robsearles.com Rob Searles

    I feel a little silly now!

    After having another browse around the interweb I found out that VirtualBox now makes life much easier for me (as of v2.1) with Host Interface. This allows you to access the Guest from the Host by simply using an internal IP (i.e. 192.168.0.blah). I had problems doing this with a Windows guest, but as soon as I fired up a small Debian server it worked like a charm.

    I recommend that you go and check out VirtualBox.org

  • http://www.robsearles.com Rob Searles

    I feel a little silly now!

    After having another browse around the interweb I found out that VirtualBox now makes life much easier for me (as of v2.1) with Host Interface. This allows you to access the Guest from the Host by simply using an internal IP (i.e. 192.168.0.blah). I had problems doing this with a Windows guest, but as soon as I fired up a small Debian server it worked like a charm.

    I recommend that you go and check out VirtualBox.org

  • shujuan3344

    This is a love poem:
    Sweet spring leak out, hangs shade all Yuan coverlet. ROM with heavy,

    double phoenix, of gold.

    Outside the window, on coming. Heartbroken, one is negative.

    Night where people forever, and cast away to sound. Incense, eyebrow

    yan, will sink convergence.

    Do not stand against the coverlet, hatred solitary. In my heart, as you

    know, beginning in yi deep.
    http://www.2ued.com

  • Pingback: Robsearles