TOPIC: HYPER-V
Creating a test web server using Ubuntu Server 13.04 and VirtualBox
1st September 2013Having seen Linux Format cover tools like Vagrant and Puppet that manage virtual machines, I have been attracted by the prospect of a virtual web server running on my own PC. Certainly, having the LAMP software stack in a VM means that the corresponding tools don't need to be added to a host system should its operating system need a fresh installation.
As intriguing as tools like Vagrant may be, I decided that I needed to learn a bit more about getting server instances set up in VirtualBox anyway. Thus, I went and downloaded the latest version of Ubuntu Server and gave that a go. One lesson that I learned was that Bridged Networking needs to be added to the VM before installation of the operating system, unless you fancy overcoming the challenge of getting Ubuntu Server to recognise an altered or additional network interface. In my case, I added an extra adapter for the Bridged Networking and left the original in place as NAT. The reason for having Bridged Networking set up is that it allows access to the virtual web server from the host once you know the IP address and that information can be obtained by executing the ifconfig
command on the virtual machine.
With the networking sorted, the next step was to install the 64-bit edition of Ubuntu Server. Unlike its desktop counterpart, this is all driven by text menus but remains fairly intuitive and there is hardly anything there that you wouldn't see with another Linux distribution. A useful addition is the addition of a menu to select the types of server services that you'd like to see installed. From this, I chose the web server and SSH options, and I seem to remember that there was a database server option too. If there was an FTP server option, I would have chosen that too, but it was no ordeal to add Proftpd later on anyway.
All of this set was done through the VirtualBox GUI, just to keep life more straightforward. Even so, I only selected 12 MB of video memory and was tempted to cut the overall memory back from 512 MB but leaving things be for now. However, what I have begun to do is start and stop the virtual machine from the command line, since servers are headless operations anyway. With SSH enabled, there is little need to have the VirtualBox GUI going. The command for starting the server is below:
VBoxManage startvm "Ubuntu Server" --type=headless
There is a VBoxHeadless
command for the same end too, but VBoxManage
does what I need. The startvm
option is what tells VBoxManage
to start the server, and the virtual machine's name is enclosed in quotes. The --type=headless ensures that no window pops up. To stop the virtual web server cleanly, a command like the following is needed:
VBoxManage controlvm "Ubuntu Server" acpipowerbutton
Again, the VBoxManage
command gets used and the acpipowerbutton
option ensures that a clean shutdown is performed. Not doing so results in the server not fully starting up, according to my experiences thus far. Getting the virtual web server to start and stop with the host machine itself starting and stopping, but this looks more complex, so I plan to leave things a while before trying that experiment.
An introduction to Wubi
14th July 2008The Toshiba laptop that I acquired at the start of the year is a Windows Vista box, and it isn't something with which I want to play too roughly because the OS came pre-installed on it. I still wish to continue to see how Vista goes at close quarters, so removing it to put Ubuntu or some other Linux distribution on there wasn't ever going to be an option that I was willing to take either. Neither was the option of setting up a dual booting arrangement using disk partitioning; I have plenty of experience of doing that to set up dual booting machines over the years, and I don't need any more than what I already have. So, I was happy to leave it as a Windows box and only as a Windows box.
That situation has changed, and the cause was Canonical's decision to go for something novel when it brought out Ubuntu 8.04. The premise is as follows: a Windows style installation that pops an entry in the Windows boot menu that allows you to fire up Ubuntu without ever having to do disk partitioning or other similar rough play. For those who are less than enamoured with the Linux option, it's even easy to remove too, as easy as any other Windows program in fact. Removal of Linux is very definitely not what I'd do, and that's even without the pain and upheaval of more customary means for setting dual booting machines. In these days of virtualisation and hypervisor technology, I have my ideas as to what has been used to give us that easy way in.
Being an Ubuntu user anyway, the possibility of having Ubuntu on the laptop and the interesting opportunity that Wubi offered for getting it on there was too tempting for me to give it a miss. A small download from the Wubi website is all that is needed to set things off. You get a number of options up front, like where to put the (large) file to be used to house the Ubuntu world and how large you might want it. Setting a username and password for the thing gets included among other items. The next stage is to download the files to be used to perform the installation. Once that is completed, and it took me a few goes to get the lot (thankfully, it stores things up to the point where the downloading operation cuts out so you didn't start from scratch each time; even so, it's still annoying and could put some off), it is time to restart the computer and boot into Ubuntu to complete the set-up of the operating system itself; it is at this point that the familiar very much returns. A reboot later, and you are into a world that does its level best to fool you into thinking that Windows is another universe and never existed on that machine at all.
So, a machine that seemed destined to only ever run Windows can run Linux now as well. Wubi comes across as a neat and clever way to get a dual booting computer, and I hope to leave mine as I now have it. No feathers were ruffled on the Windows side, and I saw no sign of any destruction. That makes Ubuntu's way of doing things a much better option than other distributions that make you go down more invasive routes when creating a dual booting PC. A question remains in my mind. Could this approach take off?