Install Ubuntu Server in VirtualBox under Kubuntu or Ubuntu

Discussions related to using VirtualBox on Linux hosts.
Post Reply
Little Girl
Posts: 7
Joined: 21. Jul 2008, 07:46

Install Ubuntu Server in VirtualBox under Kubuntu or Ubuntu

Post by Little Girl »

I recently installed Ubuntu Server 8.04 in VirtualBox under Kubuntu 7.10. I ran into a few snags along the way and got them all solved. My research on the VirtualBox page, in the user's manual and all over the Internet showed me that lots of other people run into the same snags I did. As a result, I put together two HOWTO web pages. The first page shows how to install Ubuntu Server under Kubuntu or Ubuntu:

http://littlergirl.googlepages.com/Virt ... erver.html

The second page shows what to do with Ubuntu Server once you have it in VirtualBox:

http://littlergirl.googlepages.com/Virt ... tNext.html

I'd add to the wiki on this page, but this was a monumental effort and I don't want to do it all over again in an unfamiliar format, so I figured I'd just link the pages here for anyone who needs them.

Enjoy, and I hope they help somebody!
TerryE
Volunteer
Posts: 3572
Joined: 28. May 2008, 08:40
Primary OS: Ubuntu other
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Ubuntu 10.04 & 11.10, both Svr&Wstn, Debian, CentOS
Contact:

Post by TerryE »

Hi, Good guides. A few comments:
  • Why are you installing X? You really don't need it to administer a server. Most experience admins (certainly the older ones :P) just use ssh. Running and X system and desktop takes up about 128KB. You should find that you can run happily in 384Kb and I run most of may LAMP stacks happily in 256K.
  • You don't discuss disk partitioning. At a minimum, I use 2 hdds: I partition hd0 into root, /tmp and swap. This can then be an immutable drive. I put /var onto a separate drive. This way you don't need to backup the system image.
  • One of the uses I have for my LAMP stack is a sandpit to testout and maintain forums such as this one. in this mode the ability to snap and revert the /var partition is invaluable. I uses a vboxfs mount for persistent logging but you could easily do this to a third drive.
  • You need to think about backup and recovery.
  • Have a look at the Ubuntu JeOS release. I think its great for this sort of application.
One of the things that I was considering was a sticky giving examples. Would you mind if I referenced this?
Little Girl
Posts: 7
Joined: 21. Jul 2008, 07:46

Post by Little Girl »

Why are you installing X? You really don't need it to administer a server.
It's listed as an option for anyone who prefers to control their server from a GUI.
You don't discuss disk partitioning.
Disk partitioning is a very personal issue. Put 50 geeks into a room and toss out the topic of partitioning and you'll get 50 different ideas of the best way to do it. Since my guide is aimed at newbies, I made the instructions such that partitioning was handled by the Ubuntu Server install routine. There's a note on the page for more advanced users who have their own idea of how to partition.
One of the uses I have for my LAMP stack is a sandpit to testout and maintain forums such as this one. in this mode the ability to snap and revert the /var partition is invaluable. I uses a vboxfs mount for persistent logging but you could easily do this to a third drive.
Do you mean that I should include instructions on how to mount another drive?
You need to think about backup and recovery.
I have. This is another topic where 50 geeks would come up with 50 different methods. :)
Have a look at the Ubuntu JeOS release. I think its great for this sort of application.
Thanks! I've downloaded it and will be installing it and running it through its paces momentarily!
One of the things that I was considering was a sticky giving examples. Would you mind if I referenced this?
Go for it. If it can help someone, then it's done its job. :D
TerryE
Volunteer
Posts: 3572
Joined: 28. May 2008, 08:40
Primary OS: Ubuntu other
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Ubuntu 10.04 & 11.10, both Svr&Wstn, Debian, CentOS
Contact:

Post by TerryE »

Little Girl wrote:Disk partitioning is a very personal issue. Put 50 geeks into a room...
I think you've been around the World of Windows for too long :lol: Compared to the NT "logical" hierarchies where you can have random tmp directories in the middle of your OS directories, and caches everywhere, the Linux division is very logical. The hierarchies at a root level have distinct purposes:
  • boot, bin, initrd. Code base needed to boot the OS. Largely fixed and invariant over machine in a domain. Under Config Control.
  • lib. Shared libraries and data need to run the system. Largely fixed and invariant over machine in a domain. Under Config Control.
  • sbin, (opt), usr. Code base of all the extras. Largely fixed and invariant over machine in a domain. Under Config Control.
  • etc. Configuration data Largely fixed but personalised for each machine in a domain.
  • tmp. Common repository for temporary files.
  • sys, proc, mnt , dev, media. Live system views and mount-points
  • home, root, srv, var, User and system context; that is data which changes over time.
If you think you your going to manage your VMs storage and to back it up, there is a lot of sense in splitting these over at a minimum 2 VDIs: one of which is immutable (or effectively so by archiving a reference copy), and one which evolves over time and needs to be regularly backed up.

How you control and run your VMs through the operational life-cycle is just as important as how you get them built in the first place.
Read the Forum Posting Guide
Google your Q site:VirtualBox.org or search for the answer before posting.
Little Girl
Posts: 7
Joined: 21. Jul 2008, 07:46

Post by Little Girl »

I think you just did a fine job of proving my point for me. :wink:

Once again, when speaking of disk partitioning and backups, put 50 geeks into a room and you'll get 50 different approaches to how each should be handled. That's just how it is, and this is something you can easily verify for yourself by beginning such a conversation almost anywhere.

I do not advocate any one method over another in my pages. In an effort to make my guides as user-friendly and easy to understand as possible, I try to provide the most basic possible examples, leaving it to the end users to go beyond my examples to any level of complexity they desire.

Advanced users (which you potentially number among) will either not need my guides or be easily capable of building upon them in whatever ways they see fit.

My goal is to provide help to users who need it. Hopefully they'll benefit from my guides.

I appreciate your interest and suggestions and I'll take them into consideration. Also, thanks for the JeOS recommendation. That's a nice little server!
h1d
Volunteer
Posts: 170
Joined: 3. Jul 2008, 02:10

Post by h1d »

What's with the eye killing purple?
TerryE
Volunteer
Posts: 3572
Joined: 28. May 2008, 08:40
Primary OS: Ubuntu other
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Ubuntu 10.04 & 11.10, both Svr&Wstn, Debian, CentOS
Contact:

Post by TerryE »

I think believe that tutorials should have a minimum integral content: it is dangerous to teach someone to drive without introducing what the brakes are to keep things simple. You should least have a reference "understanding how to brake is an important, and I will introduce it in my next lesson".

You may think this analogy is stretching from the issue we seem to disagree over. However, if you just introduce beginners to how to set up a tool, and don't at least introduce some of the concepts of precaution and maintenance then you might be doing them a disservice in the long run. I was trying to share very relevant experience, which is different from your pejorative "geek in a backroom".

Perhaps that you haven't yet thought about how you backup your VMs and how you use them for serious applications, yourself?
Read the Forum Posting Guide
Google your Q site:VirtualBox.org or search for the answer before posting.
Little Girl
Posts: 7
Joined: 21. Jul 2008, 07:46

Post by Little Girl »

Thanks for the suggestion for what my next tutorial should be. Since I haven't written one yet (and don't know whether I will), I modified the introduction to include the "brakes" for the new driving student. Hopefully this covers it effectively:

http://littlergirl.googlepages.com/Virt ... .html#toc1

As far as the "geek in a backroom" reference, you don't have to take my word for it. Take the two topics you feel strongly about - partitioning and backing up your virtual server - and research them in any way you'd like. Talk to a bunch of fellow Linux users and get their input on each topic. Look through books at the library or a book store. Run the topics through any search engine. You'll find that both are approached in a variety of ways, many of which are supported by sound reasoning. You and I and everyone else are free to decide for ourselves which method best suits our use of our computers.

My guide shows a user how to access their Ubuntu Server from the host via the VirtualBox Guest Additions shared folder feature, from a remote computer on the LAN via SSH and SFTP or from any computer on the WAN via SSH and SFTP. How the user then works with the contents of the virtual machine will be a personal decision.
TerryE
Volunteer
Posts: 3572
Joined: 28. May 2008, 08:40
Primary OS: Ubuntu other
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Ubuntu 10.04 & 11.10, both Svr&Wstn, Debian, CentOS
Contact:

Post by TerryE »

Let's just agree to differ, eh?

A few points on your guides:

How To Install Ubuntu Server 8.04 In VirtualBox under Kubuntu
  • You should lay down your precursors and assumptions, e.g. which Hardy Server kit are you loading and where did you download it from? You are using Vbox-OSE. Where did you get this? This has functional limitations (e.g. USB doesn't work), so you should at least mention that there are two different versions and that many users would prefer to use the PUEL version.
  • You don't discuss setting up VBox itself on the host. At a min, you should refer to UG 2.3.4.1.
  • You have a related article. It really helps to put in link URLs. I know you have the fwd reference later in line, but it does help having these as banner URLs
  • You give the server 512Mb, but it is worth mentioning that Ubuntu server will run happily in 256Mb (or 384Mb if running X)
  • Likewise, a basic server will run happily in 1Gb
  • Step 40. You should do an sudo apt-get update first. Also why are you swapping the kernel (we know why, but the reader might wonder).
  • I know that you have decided to leave GA out of this stage but it is sufficiently important that you should have a clause in sec50 re part II covering the installation of the optional VM side components of VBox.
Yes, but what do I do now that Ubuntu Server 8.04 is installed in VirtualBox?
  • Necessary S/W. You should do the sudo apt-get update and upgradefirst, followed by sudo apt-get install linux-headers-`uname -r` build-essential. Don't hardwire the kernel version. Ubuntu advise "build-essential rather than just gcc and make.
  • X S/W. I do think that you should mention that running X adds about 128Mb to memory reqs of your VM.
  • Again why are you recommending 1.5.6-OSE? Most users would prefer 1.6.2-PUEL which also includes USB and SATA support.
  • Set Up Local And Remote Networking. You've switched from guest installs to host installs without making this clear.
Read the Forum Posting Guide
Google your Q site:VirtualBox.org or search for the answer before posting.
Little Girl
Posts: 7
Joined: 21. Jul 2008, 07:46

Post by Little Girl »

How To Install Ubuntu Server 8.04 In VirtualBox under Kubuntu
TerryE wrote:
  • You should lay down your precursors and assumptions, e.g. which Hardy Server kit are you loading and where did you download it from? You are using Vbox-OSE. Where did you get this? This has functional limitations (e.g. USB doesn't work), so you should at least mention that there are two different versions and that many users would prefer to use the PUEL version.
The Hardy release is specified on the page already. Where I downloaded it from, where I got VirtualBox OSE from and the fact that there are other versions of VirtualBox are all irrelevant. The first line in the introduction at the very top of the page is, "Having trouble installing Ubuntu Server 8.04 in VirtualBox?" In other words, you already have VirtualBox installed, you already have Ubuntu Server 8.04 and you're having trouble getting it to install properly. That's why you're on my page! :D
TerryE wrote:
  • You don't discuss setting up VBox itself on the host. At a min, you should refer to UG 2.3.4.1.
This guide is for successfully installing Ubuntu Server under VirtualBox. VirtualBox is listed as one of the requirements in the Requirements section. I would think that someone who found my page would be able to find other guide pages for installing VirtualBox or any other software.
TerryE wrote:
  • You have a related article. It really helps to put in link URLs. I know you have the fwd reference later in line, but it does help having these as banner URLs
Thanks for the suggestion. I plan on designing some sort of header for my pages that has links to all of them for easy navigation.
TerryE wrote:
  • You give the server 512Mb, but it is worth mentioning that Ubuntu server will run happily in 256Mb (or 384Mb if running X)
I found a recommendation for 96 MB on the XFCE site, but since your number errs on the side of caution, I'll go with it.
TerryE wrote:
  • Likewise, a basic server will run happily in 1Gb
Thanks for the information, but it's irrelevant to the contents of my pages.
TerryE wrote:
  • Step 40. You should do an sudo apt-get update first. Also why are you swapping the kernel (we know why, but the reader might wonder).
Since the page is about how to actually get Ubuntu Server installed, but not how to fluff it out, the sudo apt-get update is at the top of the next page where the fluffing occurs. As far as why you're swapping the kernel, you overlooked the information in Step 37.
TerryE wrote:
  • I know that you have decided to leave GA out of this stage but it is sufficiently important that you should have a clause in sec50 re part II covering the installation of the optional VM side components of VBox.
Section 50 already links to the page that covers VirtualBox Guest Additions. :wink:

Yes, but what do I do now that Ubuntu Server 8.04 is installed in VirtualBox?
TerryE wrote:
  • Necessary S/W. You should do the sudo apt-get update and upgradefirst, followed by sudo apt-get install linux-headers-`uname -r` build-essential. Don't hardwire the kernel version. Ubuntu advise "build-essential rather than just gcc and make.
Thanks - love that use of `uname -r` in the command! This section is now fixed.
TerryE wrote:
  • X S/W. I do think that you should mention that running X adds about 128Mb to memory reqs of your VM.
Since this is covered in the first page, I simply added a small comment that it requires more RAM than the default setup.
TerryE wrote:
  • Again why are you recommending 1.5.6-OSE? Most users would prefer 1.6.2-PUEL which also includes USB and SATA support.
Where am I recommending 1.5.6-OSE? The only reference I could find to it in either of my pages was on the second page under the Install VirtualBox Guest Additions section where I placed an IMPORTANT note letting the user know that the 1.5.0 version of Guest Additions will not work and that they should grab the 1.5.6 version. My reason? I used it, so I know it works. At your request I've added a link to the page on which the various versions are stored so the user can make up his/her own mind which version to try.
TerryE wrote:
  • Set Up Local And Remote Networking. You've switched from guest installs to host installs without making this clear.


I'm afraid your comment is a bit confusing. The previous section has you logging off of Ubuntu Server. The section in question specifies where changes will need to be made. To prevent confusion I replaced "guest" with "VirtualBox" in the fourth bulleted item. My son also noticed that I was missing a line from the BridgeDown script instructions. This is now fixed.
TerryE
Volunteer
Posts: 3572
Joined: 28. May 2008, 08:40
Primary OS: Ubuntu other
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Ubuntu 10.04 & 11.10, both Svr&Wstn, Debian, CentOS
Contact:

Post by TerryE »

Where I downloaded it from, where I got VirtualBox OSE from and the fact that there are other versions of VirtualBox are all irrelevant.
If and when I persuade you to take a turn as answering the confused Qs here around why does my mouse not work, why can't I get my USB to work, I can't get headless to work, ... you would realise that this is far from true. It's just the combination that you picked worked for you. This is all a bit of a mine-field for the uninitiated. My advice is to "warrant" your tutorial for a specific kit.

I should have said that "the basic server will run happily in a 1Gb VDI" (or 2 Gb with a bit of head room) . If someone is playing, then there is no point in encouraging them to lose 8Gbyte of their HDD, which was what you defaulted to in your tutorial.

RE: step 37/40. Why not "Virtualbox doesn’t support kernels with PAE enabled, and since Ubuntu Server comes with one of those kernels, you won't be able to boot with it until you replace the kernel with the one that Ubuntu has tuned to work with virtualization products such as VMware and VirtualBox" this then hooks into the "-virtual" name and sets it in context.

The reason I was suggesting that you move the apt-get update and upgrade forward is when someone reads this in six month time, the apt tables in the media might be out of date. Installing linux-virtual will install the latest version account to the media (say 2.6.24-19-virtual) ten minutes later when you do the update/upgrade it then installs 2.6.24-21-virtual. ("B****r, why did I just load a kernel to have it replaced?") I need to think about this one. The media build and its drivers are consistent with 2.6.24-16-server. They seem to load with 2.6.24-19-virtual, but that isn't guaranteed. They may not with 2.6.24-21-virtual, say. Maybe your approach is safer: do a minimum change to get it to boot, and then update/upgrade consistently.
Read the Forum Posting Guide
Google your Q site:VirtualBox.org or search for the answer before posting.
Little Girl
Posts: 7
Joined: 21. Jul 2008, 07:46

Post by Little Girl »

TerryE wrote:If and when I persuade you to take a turn as answering the confused Qs here around why does my mouse not work, why can't I get my USB to work, I can't get headless to work, ... you would realise that this is far from true. It's just the combination that you picked worked for you. This is all a bit of a mine-field for the uninitiated. My advice is to "warrant" your tutorial for a specific kit.
The instructions in my guide work on VirtualBox. The issues you present are potential features of other versions of VirtualBox. They are issues with VirtualBox, which has documentation of its own.
TerryE wrote:I should have said that "the basic server will run happily in a 1Gb VDI" (or 2 Gb with a bit of head room) . If someone is playing, then there is no point in encouraging them to lose 8Gbyte of their HDD, which was what you defaulted to in your tutorial.
I checked with Ubuntu Server's documentation and the minimum recommended size is actually 500 MB with a disclaimer of size being dependent on the services one installs. This has now been corrected.
TerryE wrote:RE: step 37/40. Why not "Virtualbox doesn’t support kernels with PAE enabled, and since Ubuntu Server comes with one of those kernels, you won't be able to boot with it until you replace the kernel with the one that Ubuntu has tuned to work with virtualization products such as VMware and VirtualBox" this then hooks into the "-virtual" name and sets it in context.
Because I like my wording much better. :D
TerryE wrote:The reason I was suggesting that you move the apt-get update and upgrade forward is when someone reads this in six month time, the apt tables in the media might be out of date. Installing linux-virtual will install the latest version account to the media (say 2.6.24-19-virtual) ten minutes later when you do the update/upgrade it then installs 2.6.24-21-virtual. ("B****r, why did I just load a kernel to have it replaced?") I need to think about this one. The media build and its drivers are consistent with 2.6.24-16-server. They seem to load with 2.6.24-19-virtual, but that isn't guaranteed. They may not with 2.6.24-21-virtual, say. Maybe your approach is safer: do a minimum change to get it to boot, and then update/upgrade consistently.
Ubuntu is very good about remaining current with their releases. I'm sure that if a kernel changes, the Ubuntu Server install .iso will also receive a new kernel. The, "B****r, why did I just load a kernel to have it replaced?" is explained by the fact that you are doing an update to ensure that your copy is current.
markba
Posts: 99
Joined: 1. Oct 2007, 23:50
Location: The Netherlands

Post by markba »

My comments:

Step 7-8
A little explanation is welcome here about dynamically expanding hard disks. New people are anchious to choose 8 GB, not knowing vbox initially takes virtually no space.

Step 34
I recommend to install nothing because it is very specific for the user. Steps 35+36 are obsolete then also (they have to do with the installation of mySQL). Just point out that these applications can be added easily afterwards through 'apt-get'.

Examples:
- sudo 'apt-get install lamp
- sudo 'apt-get install openssh

Steps 38-42
By using Ubuntu JeOS ('Just Enough OS'), you can avoid loading the virtual kernel. In JeOS, this kernel is already loaded. This is already pointed out by TerryE, but this should be emphasized: JeOS is made for virtualisation, as Ubuntu Server is not; Ubuntu Server is intended for bare metal installations.

JeOS takes the bare minimum of packages, thereby minimizing harddisk-capacity (VDI) and maintenance-overhead, apart form the already loaded virtual-kernel.

Step 44
The installation of SSH-server is mentioned, but a demo if and how this works should be really nice. Connect a Window-client with putty, Linux: ssh <user>@<-session-server-ip>.

This brings me to the following: the session can only be reached by using a host-interface. Since this is not mentioned in your how-to, the session cannot be reached and in that way, openSSH is useless (until host-networking is activated). This should be pointed cause one can expect SSH works OTOB, host-networking is the missing piece.

You mention this in the whats-next howto, but I recommend that you emphasize this.
Little Girl
Posts: 7
Joined: 21. Jul 2008, 07:46

Post by Little Girl »

Step 7
I added a comment to draw the user's attention to the screenshot, which provides a pretty detailed explanation of the differences between the two kinds of drives.

Step 34
There is now a comment letting the user know this is an optional step. I wouldn't think it uncommon, though, for a user to select one or more of these software collections at this time, so I'm leaving it in for those who do.

Steps 35 & 36
These steps now have a reference to Step 34, letting the user know these steps will only occur if you made a choice in Step 34.

Steps 38 through 42
Since this guide is targeted at users who want to install Ubuntu Server 8.04 into VirtualBox, these steps are necessary and will be left in. Instead, I've made a mention of JeOS in the Introduction at the top of the page, with a link to the Ubuntu page it's hosted on so users can check it out. That page is buried under the "Features" section of the Ubuntu Server Edition page, and most people would never delve deeply enough into the "Features" section to even find it, so I'll do my part to promote it. :D

Step 44
The page is huge as it is, and its focus is how to install Ubuntu Server 8.04 into VirtualBox rather than what to do with it once you've done so. As a compromise, I added an internal link to Step 50 here, letting the user know there's more once this page is finished. I also reworded the portion about having successfully installed Ubuntu Server all ready to go, since it was a total oversight on my part to not mention the lack of connectivity at this point.

Thanks for the pointers! I hope you like the changes. :)
Post Reply