Lesson 1.3: Creating Your First Virtual Machine
In this video, I’ll show you how to set up a virtual machine (VM) using VirtualBox:
If you have problems getting your first VM to work, read the troubleshooting section below.
Video Transcript
I’m now going to demonstrate how to create a new virtual machine in a virtual box.
The first thing you need to do is click the Machine menu at the top of the screen, then choose New.
Then type in a name for your VM. The best names are descriptive, so let’s go with Debian, since that is the name of the operating system that you will be installing to this VM.
You can leave the machine folder as it is, this is where the virtual machine’s files will be stored and you can see that virtual box has automatically changed the type and the version here based on what we typed in this box.
When you’re ready to proceed, click next.
Now, this is important: Memory, the memory that you allocate to a VM must be available on your physical computer system.
You can see here that if I want to, I can assign a large amount of RAM to this VM.
You may not be able to do that if you don’t have the same amount of RAM that I have, so just make sure that you choose something that is going to allow your host operating system (that is Windows 10 in my case), make sure you choose enough so that that can still operate.
Now, I’m going to go with one thousand and twenty four megabytes, one gigabyte.
It’s also the recommended memory size.
If you’ve got four gigabytes of RAM, then allocating a quarter of that to the virtual machine should be OK.
Click next when you’re ready.
Oh, and you can change this afterwards if you get it wrong.
It’s easy to make the change later.
We do want to create a virtual hard disk now, so I want you to click create.
Leave this as the default VDI (VirtualBox) disk image.
And choose dynamically allocated here.
I want you to change the size of this virtual hard disk to 20 gigabytes.
As with the RAM, the storage space that you allocate to this virtual machine must be available on your physical system.
So, 20 gigabytes, click create.
Now, this is a dynamically allocated virtual hard drive.
So those 20 gigabytes won’t be used all at once.
They’ll be used up as we install tools and software to this new Debian operating system.
Now, the operating system isn’t actually installed yet. If you click start…
…then you will see that it’s asking for a start-up disk.
There’s nothing that this VM can boot from just yet.
So I’m going to click cancel.
And you can see that there’s an error message that says “No bootable medium found! System halted.”
We don’t have anything installed to this VM just yet.
I’ll show you how to do that very soon.
You can close the VM.
You do not need to save the machine state.
Just power off the machine.
Click OK.
Now, if when you start that virtual machine for the first time, you get a different type of error message or the virtual machine just simply won’t start, then please check the troubleshooting guide that I have provided for this lecture.
To install Debian, you will need to insert the image file that you downloaded earlier into this VM’s virtual optical drive. To do that, open the VM’s settings by clicking on settings here.
Choose storage, and then where it says empty here, click over to the right, select this little icon here, select, choose a disk file and then select the image file that you downloaded.
And while you’ve got the settings open for this virtual machine, you can make some other changes, too.
If you go to system, you can see that you can make changes to this VM’s motherboard, processor and you can also change some acceleration settings too. If you do need to change the memory, you can do that under the motherboard tab.
What I recommend here is that you increase the number of processors or processor cores available to your VM to two.
I also recommend that you go to display and change the amount of video memory available to the maximum.
That is, assuming you have enough spare memory on your physical machine.
When you’re finished making changes, click OK.
Troubleshooting
If you’re having problems with getting your first VM to work, use the following information to help you troubleshoot the problem.
It is normal to be able to install VirtualBox, and create a virtual machine without any issues, only to find that when you start your first VM, it doesn’t work. There are a number of reasons why a virtual machine might fail to start:
- Virtualisation is not enabled in your system’s BIOS or UEFI settings.
- You have another hypervisor, such as Hyper-V or VMWare installed (but not necessarily running) on your system
- The Virtual Machine has not been set up correctly
- Your system is not capable of running virtual machines (this is unlikely if you have a modern PC)
1. Virtualisation Is Not Enabled
If virtualisation is not enabled in your system’s BIOS or UEFI settings, then you must restart your physical computer, and boot into the BIOS or UEFI settings. How you do this depends on your computer, but there is often a message displayed at start-up, telling you to press a key on the keyboard, in order to interrupt normal start-up. Find out what key this is, and hold it down as your computer boots. Follow the on-screen prompts to access your BIOS or UEFI menu, and then locate the setting that enables or disables virtualisation. This setting’s name and description will vary, so you’ll need to either consult your system’s documentation, do some online searching or figure it out on your own. Take care not to alter any other settings, as this could disrupt your computer’s normal operation. Once you have enabled virtualisation, save changes, and reboot your system.
2. Conflicting Hypervisor(s)
If you already have a hypervisor installed (besides VirtualBox) such as VMware or Hyper-V (which may be enabled automatically in Windows 10 or Windows 11 Professional) then this can stop VirtualBox working.
Hyper-V
You will need to turn off Hyper-V for VirtualBox to work reliably. You will be able keep any existing Hyper-V virtual machines that you have created.
- Press the Windows key on your keyboard
- Start typing Turn Windows features on or off
- When you see Turn Windows features on or off appear in the start menu, click it
- Scroll down the list of features until you see Hyper-V
- Make sure Hyper-V is unchecked (or unticked)
- Click OK
- You will probably be prompted to restart your computer
- After restarting, attempt to run a virtual machine in VirtualBox again
VMWare
It is possible that VMWare is stopping VirtualBox from running. VMWare is a program that you will have downloaded and installed — it is not a part of Windows 10.
- You should attempt to close all VMWare windows, and make sure it is not running in the background.
- VirtualBox should still work, even if you have VMware installed.
- If you do not need VMWare, but have it installed, then try uninstalling it. Make sure you keep any VMs that you’ve created or imported.
3. Virtual Machine Not Configured Correctly
Check the video(s) again to make sure you completed all steps when creating your virtual machine. It is possible that the machine does not have a start-up disk inserted, or has some invalid settings. Usually, there will be a warning message if you try to make a change to the settings, that VirtualBox deems invalid.
Make sure you have not moved any of your VM’s files since making the VM.
4. System Not Capable of Virtualisation
If you’re using a very old PC, or a PC that does not have a modern AMD or Intel processor, then it may not be able to virtualise machines at all. You should check your system’s BIOS settings, to see if you can find a setting that relates to virtualisation.
The official VirtualBox troubleshooting documentation can be found at: