RSS Subscription
Linux Howtos & Tutorials

Enter your email:

Delivered by


NOTE:New tutorials are from LinuxCareer.com

Poll

Do you own or wish to have iPhone?
 


Linux eBooks FREE Download
A guide to programming Linux kernel modules
Introduction to Linux - A Hands on Guide
A Newbie's Getting Started Guide to Linux

Linux from Scratch - Create Your Own Linux System - Free eBook

Linux: The Hacking Solution (v.3.0)

SQLite 3 with PHP Essential Training – Free Video Training Tutorials

This guide will introduce you to the world of GNU/Linux

The GNU/Linux Advanced Administration

A Complete Beginner's Manual for Ubuntu 10.04 (Lucid Lynx)

Advanced Bash-Scripting Guide

Set up, maintain, and secure a small office email server

Partner Linux Sites:
How-To.LinuxCareer.com
Jobs.LinuxCareer.com
TuxMachines
Monsterb
LinuxBloggers
AdamsInfo
LinuxScrew
All For Linux

Unable to ssh into VirtualBox guest machine

Article Index
1. Check for VirtualBox NAT forward availability
2. create SSH port forward
3. Login to guest SSH using port forward
4. Troubleshooting,

You have just installed and running some Linux distribution within the VirtualBox guest machine. At the same time, you have discovered that you are unable to create a ssh ( Secure Shell ) connection from your host operating system to your new VirtualBox guest machine. The default behavior of the VirtualBox does not allow that connection to happen.

There are two ( possibly more ) solutions to this problem. First solution is to create a bridged network interface and link your virtual guest by changing a guest's network interface settings. This may not be as easy as it sounds, but generally it works well and setup is easy. The second solution involves a port forwarding of a port 22 to your virtual guest machine. This solution is very easy to implement, but it does not work with older VirtualBox versions.

This article will guide you to implement the easier port forwarding solution. First check if your VirtualBox version supports a NAT port forwarding by executing a following command:

1. Check for VirtualBox NAT forward availability

$ VBoxManage modifyvm | grep natpf

If you do not observe any output you would need to upgrade your VirtualBox software. Next, open up a terminal on a host operating system.

2. create SSH port forward

Find a name of your virtual guest machine: NOTE: The following command needs to be run by a user who has an ownership of the above virtual machine as this command will display only virtual machines which a current user owns. In most cases this is NOT a root user.

$ VBoxManage list vms

Execution of a following command on the host operating system we redirect any traffic coming on port 2222 to a port 22 listening on a guest virtual machine with a name "Ubuntu_10.04".

$ VBoxManage modifyvm "Ubuntu_10.04" --natpf1 "host2guest-ssh,tcp,,2222,,22"

3. Login to guest SSH using port forward

All done. Now start your guest virtual machine and ssh to with a following command:

$ ssh -p 2222 username@localhost

If your guest operating system is using a static IP address you can modify the above port forward command to specify a guest IP address.:

$ VBoxManage modifyvm "Ubuntu_10.04" --natpf1 "host2guest-ssh,tcp,,2222,10.0.2.220,22"

4. Troubleshooting,

If you are still unable to ssh to your guest virtual machine check the following:

  • check whether your host operating system is listening on port 2222

$ netstat -ant | grep 2222

  • check if sshd is installed and running on your guest operating system.

Share this linux post:

Submit Unable to ssh into VirtualBox guest machine in Delicious Submit Unable to ssh into VirtualBox guest machine in Digg Submit Unable to ssh into VirtualBox guest machine in FaceBook Submit Unable to ssh into VirtualBox guest machine in Google Bookmarks Submit Unable to ssh into VirtualBox guest machine in Stumbleupon Submit Unable to ssh into VirtualBox guest machine in Technorati Submit Unable to ssh into VirtualBox guest machine in Twitter
 
Comments for this page are closed !!!
Please visit our new Linux Forum for additional help or discussion.


Linux eBooks FREE Download