Access VirtualBox SSH and Web Server

One of the thing that differs VirtualBox from Microsoft’s Virtual PC is that VB puts guest on a subnet of the computer that you are working on. This means that it cannot be directly accessed from other computers on your network.

To enable access, you need to configure your computer to allow ports to be forwarded to the guest. Thankfully, this is quite straightforward with the VBoxManage tool, and Allister Sanchez covers it well here: Additions and SSH Access to a VirtualBox Guest.
I’m assuming that your Vitual Machine is called MyVBoxSystem. Replace this with the name of your VM.

To enable SSH:

On the host computer, run the following commands:

<code>VBoxManage setextradata MyVBoxSystem "VBoxInternal/Devices/pcnet/0/LUN#0/Config/ssh/HostPort" 22
VBoxManage setextradata </code><code>MyVBoxSystem</code><code> "VBoxInternal/Devices/pcnet/0/LUN#0/Config/ssh/GuestPort" 22
VBoxManage setextradata </code><code>MyVBoxSystem</code><code> "VBoxInternal/Devices/pcnet/0/LUN#0/Config/ssh/Protocol" TCP
</code>

This is essentially telling VirtualBox to map any access on port 22 (the host port) to 22 on the guest. On a Windows system, this is fine as you are unlikely to be running an ssh server. If you are though, just change the HostPort parameter to a port that you know is free.

To enable HTTP:

<code>VBoxManage setextradata </code><code>MyVBoxSystem</code><code> "VBoxInternal/Devices/pcnet/0/LUN#0/Config/http/HostPort" 80
VBoxManage setextradata </code><code>MyVBoxSystem</code><code> "VBoxInternal/Devices/pcnet/0/LUN#0/Config/http/GuestPort" 80
VBoxManage setextradata </code><code>MyVBoxSystem</code><code> "VBoxInternal/Devices/pcnet/0/LUN#0/Config/http/Protocol" TCP</code>

Once again, we’re passing TCP ports forward. If you already have a web server installed such as Apache or IIS, then you will probably need to change the HostPort to something like 8080.

Make sure that your VM isn’t running when you run these commands. To check that the settings are saved, you can run the following command:

<code>VBoxManage getextradata MyVBoxSystem enumerate</code>

Alternatively, open up the VM .xml file which is found in .VirtualBox/Machines/MyVBoxSystem/MyVBoxSystem.xml. The settings are found in the ExtraData node:

&lt;ExtraDataItem name="VBoxInternal/Devices/pcnet/0/LUN#0/Config/apache/HostPort" value="8080"/&gt;
&lt;ExtraDataItem name="VBoxInternal/Devices/pcnet/0/LUN#0/Config/apache/GuestPort" value="80"/&gt;
&lt;ExtraDataItem name="VBoxInternal/Devices/pcnet/0/LUN#0/Config/apache/Protocol" value="TCP"/&gt;
&lt;ExtraDataItem name="VBoxInternal/Devices/pcnet/0/LUN#0/Config/ssh/HostPort" value="222"/&gt;
&lt;ExtraDataItem name="VBoxInternal/Devices/pcnet/0/LUN#0/Config/ssh/GuestPort" value="22"/&gt;
&lt;ExtraDataItem name="VBoxInternal/Devices/pcnet/0/LUN#0/Config/ssh/Protocol" value="TCP"/&gt;

Fasthosts, You’ve let me down

This is an open letter to Fasthosts

To whom it may concern:

I’ve been a reseller of your packages for a couple of years now. There have been blips along the way, but nothing that prevented me getting my job done.

Remember when you had those floods? I was a little disappointed that I hadn’t been contacted about the situation. But you did have the problems with dedicated servers on your site as part of a newsfeed. Still, it was only for a few hours. Reading some forums and posts, I understand that I was lucky. Some were out for a day or more!

The recent issue of the security breach had me worried, so I changed a few passwords. Ultimately, I left it up to the clients to decide if they needed to change their passwords. How naive of me to think that would be the end of it.

Your policy of a blanket password reset over the last two weeks has left me and my business reeling. I’m currently in the middle of 4 development projects, and then suddenly all of my hosted mySQL databases have had their passwords reset! Any site depending on mySQL suddenly stopped working!

Needless to say a good amount of time was spent getting these going again. Resetting passwords, rewriting code etc.

But then it all went wrong.

After I fixed the first few sites, your FTP servers stopped responding. The customer services telephone queue seems to average about 1 hour (at a non-geographic national rate – I hope that you’re making a good profit from that). When I do finally get through, I get told that it’s probably because people are resetting their passwords – it will settle down soon.

Well, I’ve been waiting for it to settle down for over a week now. My development projects have stalled. Existing sites aren’t working. My clients think I’m either lazy or incompetent. I am powerless to get anything done and it’s your fault, Fasthosts.

Yet the propoganda you send out suggests everything’s alright and that you’re hitting a momentary blip. No one is standing up to be accountable for the debacle.

Clearly the blanket password reset has caused a raft of other problems, FTP, control panels, emails and so on. Service is spotty at best, support non-existent. I am incapable of doing my job.

You’ve let me down, Fasthosts. And the shocking part is you don’t seem to care. You’re irreparably damaged my business.

I’m now actively looking for a new reseller partner. It’s time for us to part ways.