What are you in the mood for today?

Sunday, 25 May 2014

Hi there, following on from VirtualBox networking. The next thing we need is to allow for easy sharing of files between the host and guest. Now we could use something like FTP or samba. However VirtualBox provides a built in feature to map a Host folder on to the guest file system. I will be honest its a bit tricky to get working, but hopefully this post should help.

So there are 4 steps to do this.

Select the folder to share

Install packages needed by VirtualBox

Install VirtualBox's guest tools

Mount the shared folder

From the main screen.
Open the settings
Click the Add icon. To add a pointer to your local folder that you want to share.
Select your folder, check "Auto-mount" & "Make Permanent"

now fire up your VM
Now, if we check are share in the bottom of the window

Ok. Before we install the "Guest tools" we need to install some required packages

sudo apt-get update

sudo apt-get install make

sudo apt-get install gcc

sudo apt-get install dkms

Now we need to attach the "Guest Tool" installer image. Its very easy
After you have click it. You won't get a prompt.
If you may get something like this
Just press "Force Unmount"
Now mount the "Guest Tool" image

sudo mount /dev/cdrom /mnt

Next to to run the installer for Linux

sudo /mnt/VBoxLinuxAdditions.run

Make the folder we want to map into

sudo mkdir /remoteShare

This will take the shared folder on the host machine mirror it to the guest folder. *remember you refer to host folder by its alias.

sudo mount.vboxsf myShare /remoteShare

Now you can move in to the folder

cd /remoteShare/

If you have added some files locally. you can see them with the 'ls' command

Saturday, 24 May 2014

Hello boys & girls. One think people my not know about me, is I love using VirtualBox as my test environment. In a nutshell: It allows you to simulate your production environment for testing your code. All without too much hassle.

So, in this post I'm going to go over a simple thing you will need, and that is to give your VM access to the Internet + network access to talk to your host.

let's dive in. For this example I'm running Windows 7 as the host and Ubuntu 14 as the guest. I'm not going to cover installing Ubuntu in this guide, but I'm sure you can find some help DuckDuckGo: Installing ubuntu on VirtualBox ^_^

Before starting the VM we will need to make a small change to the VM's settings. Because of VirtualBox internal architecture it requires two network cards in order to connect to the WAN(internet) and also connect to the host. As it will be convenient to be able to do both at the same time.. we have to do the following.

Open VirtualBox

From the main screen to go "Settings"

Now open the 2nd adapter tab. Check "Enable Network Adapter" and select "Bridged Adapter" as the "Attached to"

Now we can fire-up your VM.
First, let's take a look at what network interfaces are already set up. Enter the ifconfig command

Here we see that there are two interfaces. eht0 is giving access to the WAN.. and lo is to allow the OS(here Ubuntu) to send messages to itself, because that's just what computers want to do sometimes.

Now we need to update the network interface file. To let the OS know there a new network available.