Sunday, October 31, 2010

SSH to Virtual machine running as a service

Running virtual box as a service has many advantages however accessibility is limited. Ssh is very famous way to access virtual machines running ssh server.In this blog I will show how to setup ssh on Ubuntu as Guest running over Windows as a host and accessing Ubuntu resources through Windows machine using ssh.

On ubuntu:
$sudo apt-get install ssh

#this will prompt you sshserver. Say yes and install ssh / open-ssh server

$ifconfig

#This command will print your current IP configuration
#As virtual machine in virutal box runs as NAT usually, no static ip is attached to it.
#To ssh we will need a static IP attached to virtualbox. Lets do that.

$sudo vim /etc/network/interfaces

#This will open the file containing network configuration. Comment out existing text and write this:

iface eth0 inet static
address 192.168.10.50
netmask 255.255.255.0
gateway 192.168.1.254


#Now restart your virtual machine
$sudo shutdown -r now

Now on windows machine start putty and ssh to 192.168.10.50.

And this is it if you know your login userid and password for ubuntu.

References:
1) A bog which I dont remember anymore
2) VirtualBox
3) Ubuntu

No comments:

Post a Comment