Installing Ubuntu 15.04 on VirtualBox VM

8,727

Virtual hard drives

While installing Ubuntu to a virtual machine such as Virtual Box you will have created a virtual hard drive for holding the virtualised OS and its data. For the host OS this virtual hard drive is just a file on the real hard drive but the guest operating system can use it as if it was a real drive to partition and to format it to the guest's needs. This will leave partitions and filesystem on the real drive untouched.

Windows devices

In Windows hard drives or their partitions are assigned with letters A: B: C:, ... irrespective of where that partitions reside. This is different in Unix and in Ubuntu.

Device files of Unix and Ubuntu

For each attached block devices (and also for each virtual hard drive in a VM) we will create a device file. Modern SCSI or SATA drives will be named as /dev/sd followed by a letter depending on the sequence they were registered. Hence the first registered drive's device file will be named /dev/sda, the second /dev/sdb, the third /dev/sdc, and so forth.

After we had added partitions on that drive they will consecutively be numbered /sda1, /sda2, /sda3, .... Therefore we can easily see on which hard drive a given partition sits.

Grub and the boot device

Now for installing the master boot loader (Grub) needed for booting Ubuntu we can further specify on which drive it should be installed. This only matters in case you have more than one drive attached to your computer (or your virtual machine).

In your case you likely had created only one virtual hard drive (though more are possible) which then was named /dev/sda. This drive is where you want to install Grub, and the OS.

Note that in a virtual machine this still is a virtual hard drive, not your bare metal drive where your host OS resides.

A word on dual boot

On a real computer where we may want to choose from more than one OS we may have to take care that the boot loader is really being placed onto the first bootable drive. It will replace any other (e.g. Windows) master boot record that was there before we started. Only then a dual-boot system with a choice of operating systems at boot would be possible. If for any reasons we do not want this we can tell Grub to install on another drive (or partition), if available.

Share:
8,727

Related videos on Youtube

Chris
Author by

Chris

Updated on September 18, 2022

Comments

  • Chris
    Chris over 1 year

    I'm taking a college course on Unix, and as part of that, I am trying to use a live USB of Ubuntu on my computer. My computer runs 64-bit Windows 7. I used LinuxLive to install VirtualBox on a 16 GB flash drive. I had trouble installing 64-bit Ubuntu 15.04 using this, but was able to successfully install 32-bit 15.04. My ultimate goal: keep my Windows installation, and primarily run Ubuntu through the VM (possibly booting to it occasionally).

    I've been using running the "Try Linux" option for the last couple weeks, but from what I've read, I think I can "install" Linux on my flash drive to keep my settings (and possibly make it run faster in the VM?). I found a couple walkthrough videos on YouTube, but the screens I see are a little different. After the "download updates" checkbox screen, I get a dropdown menu which asks to set the device boot loader. The only option is /dev/sda, and trying to add a different option doesn't seem to work.

    I'm nearly a complete Unix n00b, and not ashamed to admit it. I get that /dev/sda is a drive, but which drive? Is it my computer's hard drive, my flash drive, or some virtual drive in the VM? If I install Ubuntu there, will it negatively impact my existing hard drive and Windows installation?

    • Chris
      Chris over 8 years
      Thanks, Takkat, but it doesn't really explain what /dev/sda is.