TranslateProject/sources/tech/20230602.2 ⭐️⭐️ Install Windows 11 as Guest in Ubuntu using virt-manager.md

9.6 KiB
Raw Permalink Blame History

Install Windows 11 as Guest in Ubuntu using virt-manager

A complete guide to install Windows as a guest operating system in Ubuntu, Linux Mint host using the open-source virt-manager (KVM/Qemu/libvirt).

If you are planning to get rid of Windows completely but want to access Windows-specific applications while being in Ubuntu, then its easier to try it out in a virtual machine. Although there are many virtualization applications, we will use the powerful virt-manager application for this guide.

Virtualization is the process of creating and managing virtual machines, which are isolated environments that mimic the behaviour of physical computers. Virt-manager leverages KVM, a virtualization technology built into the Linux kernel, and Qemu, a hardware emulator that enables the execution of guest operating systems.

Additionally, virt-manager utilizes libvirt, a library for managing virtualization technologies, to provide a seamless and feature-rich virtualization experience.

Before starting the Windows 11 installation, you need to prepare your system and get the Windows 11 ISO file from the official download page.

Download Windows ISO file

Visit the official download page below. Choose Windows 11 64-bit and language. And download the ISO file. The ISO size of Windows 11 is around ~6GB.

Download Windows 11

Windows 11 Download location

Install and Set up virt-manager in Ubuntu, Linux Mint

Open a terminal and run the following command to install virt-manager.

sudo apt install virt-manager

After installation is complete, add the current user to the libvirt group. For the below example, replace “debugpoint” with your user name of the Ubuntu/Linux Mint system.

sudo adduser debugpoint libvirt

Then, start the libvirt daemon using:

sudo systemctl start libvirtd

And finally, start the virtual network.

sudo virsh net-start default

This should complete the installation of the virt-manager. For a detailed installation guide, visit this tutorial.

Set up TPM 2.0 in Ubuntu for virt-manager

One of the requirements of Windows 11 is TPM 2.0 (Trusted Platform Module 2.0). TPM is a hardware-based security mechanism enabling Windows 11 to perform secure facial-based authentication, BitLocker, etc.

However, if you install it in a virtual machine, you have to tweak certain settings in virt-manager and need specific packages.

Open a terminal and install the following packages.

sudo apt install ovmf swtpm swtpm-tools

Install Windows 11 in virt-manager on Ubuntu, Linux Mint

Before you proceed, make sure to reboot your Ubuntu or Linux Mint system after installing the above packages.

Create virtual machine

Open “Virtual machine manager” from the application menu. Click on New.

New Virtual machine

In the “New VM” window, choose “Local install media..”. Click Forward.

New VM window

Choose the downloaded Windows 11 ISO file by clicking Browse > Browse****Local button. Click forward.

Select the Windows 11 ISO file

Enter memory as 8 GB or 8192 and CPU as 4. This is the minimum value. You can enter more if your hardware is capable of this setup. Click forward.

Memory and CPU

Enter storage as 40 GB (minimum) on the next screen. Make sure to check the “Enable storage for this virtual machine”. And click forward.

Enter storage size

In the final screen, give a name to your virtual machine. For example, I gave “win11”. Make sure to check the option “Customize configuration before install”. Click finish.

Final screen for initial set up

Configure TPM and other parameters

In the configuration window, go to the “Overview” page. Select the following values. Keep the rest unchanged.

  • Chipset=Q35
  • Firmware=BIOS

Note: You may choose UEFI modules, but the Windows 11 ISO will not boot and may get stuck in the TIANOCORE Plymouth screen.

Set Chipset and Firmware

Go to the CPU page and make sure the vCPU allocation = 4.

Click on the “Add Hardware” button at the bottom left.

Add hardware

Select TPM from the left pane. Then select the following and hit Finish once done.

  • Type: Emulated
  • Model: TIS
  • Version: 2.0

TPM settings

You should see the TPM 2.0 on the left side of the window. Now all the configuration is complete.

Begin installation

Hit the “Begin installation” button at the top.

Installing Windows 11

If all goes well, you should see the Windows logo and followed by the below screen. Choose Language, Keyboard and hit Next.

Windows 11 installer in virt-manager - first screen

Click Install Now on the next screen. Wait for a few moments.

On the active Windows page, click on “I dont have a product key”.

Product key page

Select Windows 11 Home in the version selection screen.

Select Windows version

Note: If you received the following error after clicking Next in the above screen “This PC cant run Windows 11”, then do the following to bypass all the checks.

If you dont find this error, skip this section.

Compatibility error

Press SHIFT+F10 to bring up the command prompt.

Type regedit and hit enter.

Open registry editor

Go to HKEY_LOCAL_MACHINE\SYSTEM\Setup.

Right-click and select New > Key. Add the key name as LabConfig.

While LabConfig is selected, add New > DWORD (32 bit) Value. Add the name as BypassTPMCheck. Then right-click on the name and select Modify. Give the value as 1.

Adding key values

Repeat the above steps to add BypassRAMCheck and BypassSecureBootCheck.

Set the value to 1 for both.

Finally, the LabConfig key set up should look like the below:

Final key setup

Close the registry editor and command prompt. Click on the back arrow to start the installation process.

Select “Custom: Install Windows only (advanced)” in the Windows set up screen. Select the virt-manager driver and hit next.

The installation will start. Wait for a few minutes for it to complete.

Windows 11 install started in virt-manager

Setting up

If all goes well, you should see the first set-up screen for Windows 11 inside virt-manager. It will be a series of screens where you need to provide various settings.

Windows 11 boot up - first screen

Follow the on-screen instructions in the next few screens. Remember that Windows 11 requires an online Microsoft account to log in, such as Hotmail, Office 365 or Outlook. And you need to be connected to the internet.

If all goes well, you should see Windows 11 running inside virt-manager in Ubuntu or Linux Mint.

Windows 11 running as guest in virt-manager

Conclusion

I hope by following the step-by-step process outlined in this article, you can set up a virtual machine using virt-manager and install Windows 11 as a guest in Ubuntu or Linux Mint host.

If you run into errors, do let me know in the comment box.


via: https://www.debugpoint.com/install-windows-ubuntu-virt-manager/

作者:Arindam 选题:lkxed 译者:译者ID 校对:校对者ID

本文由 LCTT 原创编译,Linux中国 荣誉推出