To make the Raspbian virtual machines easier to work with, I’m going to set up a VirtualBox SSH network. This will allow me to SSH from my Host machine to the virtual machine guest OS. In this case, the Raspberry Pi Desktop is my guest operating system for this guide.
While there are other ways to set up a Virtualbox SSH network, in this guide, it is about keeping it simple. Thus keeping it simple will make it easier to remember the configurations for each virtual machine we set up.
After following this guide you will be able to:
- Use an FTP client to transfer files between host and virtual machine.
- Edit code on a virtual machine remotely with some text editors.
- Use a terminal application like PuTTY to access a virtual machine.
Virtualbox SSH Network Setup
From here, you need at least one Raspbian virtual machine master ready to clone. However, if you have not got this far, you can find a guide to setting up a Raspbian virtual machine here.
Virtualbox SSH Host Adapter Setup
We need to check that we have at least one network adapter enabled for the Virtualbox host. Also, we enable DHCP server for the host adapter to keep the virtual SSH configuration to a minimum.
So to check for Virtualbox host adapters, select File then Host Network Manager from the menu. A new window will pop up that will display host adapters if any are set up. On my Virtualbox, I had one adapter set up already so I did not have to do anything else.
However, if your Host Network Manager did not show any adapters in the list, select create. After selecting create, details of the adapter will be created automatically and will appear in the list. Then tick the checkbox to enable DHCP Server.
Virtualbox SSH Guest Adapter Setup
Clone the Master Copy
Since the host has DHCP Server running, we will not need to setup a static IP address for the virtual machines. So this will simplify network configuration for each of our virtual clones we create.
We want to keep our initial virtual machines, tagged as MASTER, clean. So the virtual machines we want to work with are clones of our MASTER copy. Create a clone by mouse-right-clicking on the MASTER virtual machine copy. Select clone from the pop-up menu. In the clone configuration, use the following settings.
- Choose a name for the clone, for example, Pi_Jessie_clone01.
- Then tick the checkbox to reinitialize the MAC address of all network cards.
- Next, choose full clone.
Add Network Adapter
The clone might already have a network adapter set up. So choose Adapter 2 from the tab.
- Tick checkbox to Enable Network Adaptor.
- Attach to Host-only Adapter. This is the adapter you will find in the Host Network Manager.
- Adapter name will auto-fill and can be left at default.
Virtual SSH Network Enable
To complete the settings, to enable the virtual SSH network we need to start the virtual machine clone we created. So start the virtual machine clone to boot to the Raspberry Pi Desktop.
If you open a terminal window on the Raspberry Pi Desktop we can check the network adapter settings. At the command prompt run:
ifconfig
So you will note there are two network adapter configurations. The one of interest is eth1. The IP addresses of the virtual machines tend to start at 192.168.56.101. Once you know the IP address of the virtual machine clone, the IP address can be added to connection managers of various network clients you might use.
So that we can SSH to our Raspbian virtual machine we will enable SSH through the Raspberry Pi configuration. From the Raspberry Pi Desktop, Select Raspberry Pi configuration from Preferences in application start menu. Mouse-click Interfaces tab and enable SSH.
You should now be able to SSH into the Raspbian virtual machine from the host computer.
Related Articles
Raspberry Pi Raspbian Virtual Machine on your Desktop – Link.
Raspberry Pi Headless Install Without A Display Guide – Link.
Beginners Guide to Raspberry Pi Configuration – Link.
Buying Featured Items
The purchase price is going to vary greatly depending on how quickly you want the items. Therefore shop around checking out Amazon, Ebay, Adafruit and local electronic stores.
UK Searches:
UK Amazon:
US Searches:
US Amazon:
On Closing
I hope you find this article useful – VirtualBox SSH Network Guide – Raspberry Pi Desktop, please like and share.