Installing and Configuring Virtualbox

Table of contents

  1. Download Virtualbox
    1. Enable virtualization
  2. Creating a VM
  3. Configure Your Resources
  4. Configure Disks
  5. Add the iso to the system
  6. Configure Port forwarding
    1. About Port forwarding and SSH
    2. Instructions
  7. Press Start
  8. Return back to main setup

Download Virtualbox

Enable virtualization

If you’re on a windows/linux computer make sure that you have Virtualization on in your bios settings. See steps below for info

Linux
  • run `systemctl reboot --firmware-setup`
  • look around your BIOS, and turn on virtualization
  • this will be called: VT-x, AMD-V, SVM, or hardware virtualization
Windows
To Check if you have virtualization enabled:
  • Open task manager
  • go to advanced -> performance -> cpu
  • check if Virtualization is enabled
  • If it is, you do not need to continue

To Enable Virtualization
  • Open the windows menu, and press the power options
  • hold `shift` and press restart
  • you should then enter a windows boot menu, go to advanced options
  • go to "reboot into UEFI settings"
  • look around your BIOS, and turn on virtualization
  • this will be called: VT-x, AMD-V, SVM, or hardware virtualization

Users of Mac’s do not need to worry about this.

Creating a VM

  • Press “New”
  • Give it a name (like 13s)
  • Change the type to Linux
  • Change the version to “Other Linux (64 bit)” or “Ubuntu 22.04 Jammy Jellyfish” (it does not matter)

Configure Your Resources

  • Increase the memory, to at least 4GB and ideally 8GB
  • If you have a system with many cores (more than 4), increase the Processors.
    • If possible, increase the processors to at least 2

Configure Disks

  • Leave the “Create a virtual hard disk file” option checked
  • Increase the disk size. If you can, 32GB is recommended, and should be enough. Try to keep it above 24GB.

  • Double check your options and press “Finish”

Add the iso to the system

  • Open settings for your new vm
  • go to Storage
  • In IDE Controller Settings, find “Empty” with a CD icon
  • Check the “Live CD” box
  • Press the CD button, under attributes in the optical drive section.
  • Press “Choose a disk file”
  • Navigate to your Ubuntu Image, and add that to your VM

Configure Port forwarding

About Port forwarding and SSH

  • ssh: Secure Shell
  • Host OS: the OS that is running on your computer (Mac or Windows)
  • Guest OS: The os that we are running in our virtual machine.

Port forwarding allows us to access services running on our guest OS (Virtual machine) on our Host OS (computer). The service we will be using the most is ssh, which will be critical in this course, and probably later in life also. SSH runs on port 22 by default, but can be configured to use anything. Because we may want to run SSH on both our host and guest OSes, we can not use port 22 for our host OS ssh port. Therefore, we will use 2222, a (usually) open port that is often used as a backup for SSH.

Instructions

  • Open VirtualBox, select your virtual machine on the left side, and click the Settings icon to open configuration options for that virtual machine.
  • Go to the network settings
  • For “Adapter 1”, Press “Advanced”
  • Press “Port Forwarding”
  • Press the green “+” icon in the top right
  • Change Host port to “2222” and Guest port to “22”
  • Press “OK”

Press Start

Return back to main setup