There are several reasons a Linux user would want to create a Windows virtual machine, and VirtualBox is easily one of the most popular hypervisors available for Linux. It’s simple to use, easily accessible, and extremely flexible in what it allows you to do with your virtual machines. In this guide, you’ll learn how to install Windows in VirtualBox in Linux.
Tip: other than Windows, you can also install macOS in Virtualbox.
Installing VirtualBox
There are two ways to install VirtualBox in Linux. The first is to go to the website and download whichever package works for your system. Follow the steps below:
- Go to the project website and click the big “Download VirtualBox 7.0” button.
- Click “Linux distributions” on the Downloads page.
- You’ll be brought to a list of compatible Linux distros on which you can install VirtualBox. Click whichever one you’re looking for.
- Follow the download prompts, and the package installer should automatically install the package.
However, there are some challenges with that. Generally, just installing the RPM or DEB will miss building the kernel modules necessary, which can bring up many errors. The way to get around that is to install VirtualBox from your distro’s repository. This is usually a simple command to install, depending on your distribution.
For Ubuntu and its derivatives:
sudo apt install virtualbox virtualbox-guest-additions-iso
Downloading Windows 11
For those who may not be aware, Windows 11 is actually free to download and use. You can’t use it in a production environment without paying for it, but if it’s purely for personal purposes, it’s fair game.
- Download Windows 11 by going to Microsoft’s Windows Download page.
Tip: aside from installing Windows from an ISO, you can also download an official VM image for Windows that comes already configured for VirtualBox.
- Scroll down to where it says “Download Windows 11 Disk Image for x64 devices.” Choose whichever is the latest edition and click “Download.”
- Choose your product language and click “Confirm” again. Unlike previous versions, Windows 11 does not come with a 32-bit version. To download the ISO, click the “64-bit Download” button.
Note: the download may take a while, especially on a slow network connection, as the ISO image is almost 5GB in size.
Once you click “64-bit Download” and save it to your machine, you’re ready to create your Windows 11 virtual machine in VirtualBox.
Do you know: other than VirtualBox, you can also install Windows 11 in Raspberry Pi.
Creating the Windows 11 Virtual Machine
- Once your download is finished, open VirtualBox and click “New.”
- Type “Windows 11” in the “Name” section. That will automatically choose the “Version” to “Windows 11 (64-bit).” From there, name it anything you want.
- Click the “ISO Image” textbox and select “Other.” This will open a small dialog box where you can select the Windows 11 ISO image that you obtained earlier.
- Once you have the ISO loaded, click “Next.”
- Go to the “Username and Password” group and write the credentials you want for your Windows 11 account.
- Go to the “Additional Options” group. Change the values in both the “Hostname” and “Domain Name” textboxes. For this, you can write any value that you want as long as the Domain Name is two characters long.
- Click the “Guest Additions” checkbox and click “Next.”
- Go through the menu and set whatever you’d like for the configuration of the virtual machine. I’d recommend at least 4096MB memory and creating a 60GB virtual disk.
- After you are done creating your virtual machine, VirtualBox will automatically start and install Windows 11 in the background.
Once Windows is installed, you may notice that it’s complaining about inadequate video drivers and that you’re limited to a very small screen. To fix all that, you will need to install VirtualBox Guest Additions.
Installing VirtualBox Guest Additions in Windows
- With the VM running, click the “Devices” menu item and select “Insert Guest Additions CD Image.”
- Open the File Explorer and click on “This PC.” You should see the icon for the Guest Additions CD Image on the bottom next to “Local Disk (C:).” Click on the Guest Additions CD Image icon.
- Click on “VBoxWindowsAdditions” and “Yes” on the UAC dialogue.
- Click “Next” through the installer dialogue, accepting all defaults. Additionally, click “Install” when you get the dialogue asking to trust software from Oracle.
- Once the installation is finished, click “Finish,” and your VM will reboot.
With that done, the Guest Additions are installed, and you can experience true 3D acceleration, screen size selection, and many of the other great benefits that come with using VirtualBox Guest Additions, like shared clipboards and file sharing from Host to Guest and back.
Tip: learn how to share USB and network devices in VirtualBox.
Transferring Files from Linux to Windows 11
Another benefit of enabling VirtualBox Guest Additions is that it allows you to seamlessly transfer files between your host Linux machine and Windows 11. This can be helpful if you are using your VM for data processing and need a way to push and pull files from your guest operating system. To get started, follow the steps below:
- Click the “Machine” menu item, then “File Manager.”
- Provide the user credentials for your guest operating system and click “Open Session.”
- From here, you can transfer files from your host to your guest machine by clicking a file under the “Host File System” picker.
- Go to your “Guest File System” picker and click the “Home” icon on top of the picker box.
- Click the “Right Arrow” button in between the Host and Guest file pickers.
Creating a Permanent Shared Folder in VirtualBox
While using the File Manager utility allows you to transfer files from your host to your guest OS, there are instances where you might need a more permanent channel between them. To this end, VirtualBox provides a “Shared Folder” feature, which is used to create a link between your two machines.
- Click the “Devices” menu item in the guest OS’s menu bar.
- Hover amd slide over to the “Shared Folders” item, then click the “Shared Folders Settings.”
- Click the small Folder Icon in the setting window’s upper right sidebar.
- Click the “Folder Path” drop-down list, then click “Other.”
- Select the folder that you want to use in your host OS from the File Picker menu.
- Provide a simple name describing your new folder, then click the “Auto-Mount” checkbox.
- Click “OK” on both the “Add Share” and “Shared Folders Settings” windows.
You can access your folder in the guest OS by going to the File Explorer, then clicking “This PC.”
Good to know: while a Share Folder allows you to back up files inside your VM, you can also make an OVA file in VirtualBox, which will create a reproducible image that you can reinstall at anytime.
Frequently Asked Questions
Why does my Windows 11 VM keep crashing on startup?
While this can be due to a number of issues, the most common cause for this is a BIOS setting that disabled your machine’s virtualization features. To fix this issue, go into your system’s BIOS and enable any setting that contains either an Intel VT-x/VT-d or AMD-V.
How do I fix my VM, as it’s slow and sluggish when running?
This is most likely due to a lack of available system resources in your host machine. As such, you can fix this by making sure that VirtualBox is the only heavy program that is running whenever you boot a guest operating system.
Why am I getting a UEFI Shell whenever I boot my Windows 11 ISO?
This happens whenever VirtualBox tries to load a guest operating system using UEFI. By default, VirtualBox only uses UEFI as a fallback mode for pickier operating systems and will not boot Windows 11 under UEFI.
Image credit: Unsplash. All alterations and screenshots by Ramces Red.
Subscribe to our newsletter!
Our latest tutorials delivered straight to your inbox
اكتشاف المزيد من نص كم
اشترك للحصول على أحدث التدوينات المرسلة إلى بريدك الإلكتروني.