VirtualBox Ubuntu
Instructions to get an Ubuntu Linux distribution running in a VirtualBox virtual machine.
Install VirtualBox
On a Windows Host
Download from https://www.virtualbox.org/wiki/Downloads
https://download.virtualbox.org/virtualbox/6.1.16/VirtualBox-6.1.16-140961-Win.exe f6f6a4e5aebca49e025ba76f9a41507a
Run the installer
Click through dialogs
It is not necessary to install USB
- start VirtualBox (e.g., from start menu)
- File, Preferences, General/Default Machine Folder; Remove space from "VirtualBox VMs" This may not be worth the hassle. Spaces and caps in unix filenames, the horror
WARNING: If you are using Docker and have the Windows Hyper-V backend installed, you may have to uninstall it for VirtualBox to work.
Download an Ubuntu Image
Download a pre-built VirtualBox machine image from the FTP/HTTP server.
- Using a web browser, navigate to http://redhat5.ddci.com/Workstation/ubuntu-20210106/vmimages
- Select the appropriate zip file (ubuntu-20.04-ddci.zip) and copy to your VirtualBoxVMs directory.
- Unzip the file into the VirtualBoxVMs directory.
Create a Virtual Machine
Turn on the Oracle VM VirtualBox Manager
- Machine, then Add
- navigate to the C:\<wherever>\VirtualBoxVMs\Ubuntu-20.04\Ubuntu-20.04-ddci.vbox
- Select Open
- In right hand pane toolbar, click Start.
- Note If you run into this error:
Cannot register the DVD image 'C:\Program Files\Oracle\VirtualBox\VBoxGuestAdditions.iso' {f5022f2e-0adc-4767-879d-65058a5578c5} because a CD/DVD image
- Open the .vbox file in a file editor and remove the GuestAdditions line:
<DVDImages><Image uuid="{fd686a98-c1a6-42d9-82aa-67728b524d53}" location="C:/Program Files/Oracle/VirtualBox/VBoxGuestAdditions.iso"/></DVDImages>
- Note If you run into this error:
- "System Configuration: Welcome" dialog: Pick your language.
- Click Continue.
- "System Configuration: Keyboard layout" dialog: Pick your keyboard.
- Click Continue.
- "System Configuration: Where are you?" dialog: Pick a place.
- Click Continue.
- "System Configuration: Who are you?" dialog:
- "Your name:" Enter, well, your name.
- "Your computer's name:" Pick a name like shh-ubuntu-20.04-vm or alarson-ubuntu-vm (You want this to be unique).
- "Username:" Enter your Windows domain username as the Ubuntu username (Ex: shh, bcronk, etc.).
- "Choose a password:" Whatever you usually use.
- "Confirm your password:" Type it again.
- Choose "Require my password to log in" (not "Log in automatically").
- Click Continue.
- Wait for the system to configure then it will reboot.
- "Online Accounts" dialog: Click Skip (upper right).
- "Livepatch" dialog: Click Next (upper right).
- "Help improve Ubuntu" dialog: Select "No, don't send system info". Click Next (upper right).
- "Welcome to Ubuntu: Privacy" dialog: Click Next (upper right).
- "Ready to go" dialog: Click Done (upper right).
- If the "Software Updater" dialog appears: Click X (upper right).
- Just for giggles, open a terminal window (Right click on the desktop and select "Open in Terminal") and enter:
- docker run --rm hello-world
- docker image remove hello-world
- If you need more space for the virtual drive (default is about 25GB) then power off the vm and:
- Click File->Virtual Media Manager. Increase Virtual Size (double click desired drive if it is not showing). Click Apply and power up the VM. Allocate new space in gparted.
- Select the partition you would like to extend and drag the bar to the desired amount. If no unallocated space is available you may have to specify some by powering down and going to the VirtualBox Manager.
- Power up the vm and open a terminal window and enter:
- sudo apt-get install gparted
- gparted
Mounting drives
This needs to be done by the end user the first time they log in.
This mounts the Windows C drive in the the guest's /mnt/c directory.
VM Main Menu->Machine->Settings..., then:
- Shared Folders
- Mount C drive
- Machine Folders, then select the "Add new shared folder+" (add) icon
- Folder Path: C:\
- Folder Name: C_DRIVE
- uncheck Auto-mount.
- Mount point: this can be anything you like, including blank.
- Make Permanent: checked.
- Click OK.
- Click OK again.
- Machine Folders, then select the "Add new shared folder+" (add) icon
- Mount Home directory (optional)
- Machine Folders, then select the "Add new shared folder+" (add) icon
- Folder Path: The host path to the home directory to be used for your virtual machines, e.g., c:\home\bcronk
- Folder Name: the host OS's user name, e.g., bcronk.
- uncheck Auto-mount.
- Mount point: this can be anything you like, including blank
- Make Permanent: checked
- Click OK.
- Click OK again.
- Machine Folders, then select the "Add new shared folder+" (add) icon
- Mount Network folders (optional)
- Machine Folders, then select the "Add new shared folder+" (add) icon
- Folder Path: The host path to the network folder to be used for your virtual machines, e.g., \\nx3000\ship
- Folder Name: Folder name that we pointed to, e.g., ship
- check Auto-mount.
- Mount point: this can be anything you like, including blank, e.g., \media\ship
- Make Permanent: unchecked
- Click OK.
- Click OK again.
- Repeat for any additional network folders.
- Machine Folders, then select the "Add new shared folder+" (add) icon
- Mount C drive
You will need to open a terminal for the following steps. Right click on the desktop and select "Open in Terminal".
# Arrange to mount c drive: DO NOT use sudo -i here, the $HOME etc variables are user specific. sudo mkdir -p /mnt/c sudo bash -c "echo 'C_DRIVE /mnt/c vboxsf' >> /etc/fstab" # Optional: Share VM home directory with host VM directory. Untested! YMMV. sudo bash -c "echo '$USER $HOME vboxsf uid=$UID,gid=$(id -g)' >> /etc/fstab" sudo mount -a
NOTES
The above does what can also be done interactively using this command:
sudo mount -t vboxsf C_DRIVE /mnt/c
The above is based on many net searches including:
- https://askubuntu.com/questions/252853/how-to-mount-a-virtualbox-shared-folder-at-startup
- https://help.ubuntu.com/community/VirtualBox/SharedFolders
TODO: Might also want the above commands to specify modes and mask options.