Skip to content

Instantly share code, notes, and snippets.

@Elliria
Created March 24, 2026 19:08
Show Gist options
  • Select an option

  • Save Elliria/c914d0f4e2216070e704cc1c5724436e to your computer and use it in GitHub Desktop.

Select an option

Save Elliria/c914d0f4e2216070e704cc1c5724436e to your computer and use it in GitHub Desktop.

VirtualBox Use

About

This document provides an example of creating a virtual machine in VirtualBox, cloning it, using the clone for tests, and deleting the clone. Note that cloning it is entirely optional, but can be handy for testing out software without constantly having to create virtual machines from scratch. Power-users can also use snapshots to achieve the same goal, but since those are a bit tricker to use than clones, I'm not including steps for those here.

Before you begin

When naming a new virtual machine, the name matters to the extent that VirtualBox pays attention to it, watches it for known keywords, and adjusts the VM's settings if a known keyword is detected. If, for example, you give a new VM the Ubuntu name, VirtualBox will automatically change the default Windows entries to Ubuntu entries. Alternatively, if you give a new VM the Foo name, the default Windows entries will be used and you'd need to adjust those entries manually if you wanted to use other settings.

Create a virtual machine

  1. Create the virtual machine:
    1. Download an .iso file from a Linux distribution onto your host computer (for example: from Ubuntu).
    2. Put the file that you downloaded into your default machine folder (if you don't know or remember where that is, click the File menu in VirtualBox, choose Preferences... from the context menu, and look in the Default Machine Folder text box.
    3. Click the New icon in the toolbar or click New... in the Machine menu.
    4. Type a name for your virtual machine into the VM Name textbox (for example: Ubuntu 24.04).
    5. Use the VM Folder drop-down menu to choose a folder to store your virtual machines in.
    6. Use the ISO Image drop-down menu to browse to your ISO file.
    7. Remove the check from the Proceed with Unattended Installation checkbox.
    8. Click the expansion arrow to the left of the Specify virtual hard disk entry.
    9. Verify that the Disk Slider setting is at least 25.00 GB or move the slider higher.
    10. Click the Finish button.
  2. Configure the virtual machine:
    1. Right-click your virtual machine in the left panel and choose Settings from the context-menu.
    2. Scroll down to the System section in the right pane.
    3. Move the Base Memory slider in the Motherboard tab to 8192 MB.
    4. Move the Number of Processors slider in the Processor tab to 2.
    5. Scroll down to the Display section in the right pane.
    6. Move the Video Memory slider to 128 MB.
    7. Put a check-mark in the Features checkbox for 3D Acceleration.
    8. Click the OK button.
  3. Install the operating system in the Virtual Machine:
    1. Double-click your virtual machine in the left panel to run it.
    2. Install the operating system the same way you would if you had booted your computer from a USB stick.
    3. Close the Mouse Integration...* panel on the right side of VirtualBox when it opens up.
    4. When the installation is finished and you're prompted to remove the installation medium and press the Enter key, just press the Enter key.
    5. Sign in to the operating system.
    6. Grab all the available updates.
    7. Shut down the operating system normally.

Clone the virtual machine

  1. Right-click your virtual machine in the left pane and choose Clone... from the context menu.
  2. Verify that the Full clone radio-button is selected and select it if it's not.
  3. Click the Finish button.
  • Note that when I clone Ubuntu 24.04, the clones takes up 7.2 GB of space.

Use the clone

  1. Double-click your clone in the left pane to run it.
  2. Log in to the operating system.
  3. Do your tests.
  4. Log out of the operating system normally.

Delete the clone

  1. Right-click your clone in the left pane.
  2. Choose Remove... from the context menu.
  3. Put a check-mark in the Delete the virtual machine files and virtual hard disks checkbox.
  4. Click the Remove button.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment