Windows 11
Written on Aug 11, 2026

If you're running Linux as your computer's primary operating system, and you have a valid Windows 11 product key, you can run Windows 11 in a virtual machine. If your computer came with Windows 11 preinstalled, your product key may be embedded in the firmware.
To retrieve it, run this from the command line in your terminal:
sudo strings /sys/firmware/acpi/tables/MSDM
The last line of output text will display your 25-character product key. While it's embedded in my laptop, it isn't embedded in my mini PC.
Create the Virtual Machine
Create a new virtual machine. Use a simple name for it, without spaces. When you get to the part where you have to enter the details for "Setup unattended guest OS installation", enter your product key. Ensure you click the checkbox for "Install Guest Additions".
Don't change the virtual hardware or virtual hard disk information. Windows 11 will install with as little as 4 gigabytes of memory allotted to it, and 80 gigabytes is more than sufficient for file storage. When you click on "Finish", Windows 11 will begin installing.
The Installation
I've never bothered checking how long it takes to complete the initial installation. I'm usually doing something else and just checking on it from time to time. Once installation is complete, go into the settings and select Windows Update. It's never up-to-date regardless of the display.
While the updates are downloading and installing, adjust your power settings so that nothing affects the virtual machine. You can also adjust the scale of your display. Once the updates are finished, restart and let it finish updating before the main display appears again.
Everything is complete and up-to-date at this point. I recommend you shut it down, go into the directory with all the virtual machines, and make a copy of the subdirectory for this virtual machine. You can always revert to it should you screw something up.
You don't have to activate Windows 11 to use it. Being able to personalize it makes it worth it. I've never been able to activate it in a virtual machine the normal way, but you can run this script in the terminal as admin and it will work:
irm https://get.activated.win | iex
Press 1 to get it going and then press 0 to exit when it's done.
Remove Everything You Don't Want
If you're okay with all the nonsense that Microsoft has added to Windows 11 over the years, go ahead and use it as it is. If you want to get rid of all the things you don't want, however, please follow along. Read these articles:
- 12 Common Windows Apps You Should Uninstall Immediately, According To Experts
- Windows 11 can feel loud and distracting out of the box — here are the features I disable immediately to make the OS calmer and easier to use
Some of that information won't be interesting to virtual machine users like me. I use "Winhance" to do a lot of the work for me:
irm https://get.winhance.net | iex
Go to "Optimize" in the left column and then "Quick Actions" in the upper right. Select "Apply Recommended Settings". Go to "Customize" in the left column and then "Quick Actions" in the upper right. Select "Apply Recommended Settings".
Once again, go to the left column and select "Software & Apps". Above the apps, select "Select All Installed". Unselect the apps you want to keep. I recommend keeping "App Installer", "Microsoft Store" and "Terminal". Some apps can be reinstalled if you make a mistake.
Select "External Software" at the top and you'll find applications that work much better than what Microsoft provides.
Conclusion
After doing everything you think is necessary, you end up with an extremely lean version of Windows 11 in your virtual machine, containing only the applications and services you want to keep.
I recommend you shut down or save it, go into the directory with all the virtual machines, and make a copy of the subdirectory for this virtual machine. All it takes is one bad Windows update to make you start all over again.
Image by Pabitra Kaity from Pixabay