Уровень сложностиПростой
Время на прочтение5 мин
Количество просмотров5.6K
В данной статье описывается пошаговая методика развертывания виртуальной машины (ВМ) с установленной операционной системой Windows 10 на сервере с операционной системой Ubuntu. Решение предполагает установку всех необходимых компонентов, настройку виртуализации с помощью QEMU/KVM, а также организацию удалённого доступа к ВМ посредством noVNC. Аналогичный подход может применяться и для создания ВМ с Windows 11, однако при её установке необходимо учитывать минимальные требования к оборудованию.
> Замечание. Не у всех хостинг-провайдеров реализована возможность виртуализации (nested virtualization), поэтому для успешного развертывания рекомендуется использовать проверенные сервисы, такие как Timeweb. Моя ссылка с небольшим бонусом: https://timeweb.cloud/r/xillusion
Исходный код bash-скрипта для установки:
https://gist.github.com/amlkyc/a6ac7e05d5f121658d21478868604f79
Спасибо Claude за помощь в написании и дебаге.
Для загрузки и запуска скрипта можно выполнить следующие команды:
wget https://gist.githubusercontent.com/amlkyc/a6ac7e05d5f121658d21478868604f79/raw/16865eaaad6a67873d444c07640d73e8cfa8727c/installWin10noVNC.sh
chmod +x installWin10noVNC.sh
./installWin10noVNC.sh
Далее, подробнее о том как работает скрипт.
1. Подготовка VPS и установка необходимых пакетов
Для начала необходимо убедиться, что на сервере работает актуальная версия Ubuntu и имеется возможность установки виртуализации. В первую очередь обновляются системные пакеты:
apt-get update && apt-get upgrade -y
Далее устанавливаются необходимые пакеты:
-
Пакеты для работы с QEMU/KVM и libvirt (qemu-kvm, libvirt-daemon-system, virtinst, libvirt-clients, bridge-utils, qemu-utils);
-
Утилиты для загрузки файлов (wget, curl);
-
Python 3 и Git для установки и работы с noVNC.
Кроме того, после установки необходимо активировать службы libvirtd и virtlogd, что обеспечит стабильную работу виртуализации на сервере:
systemctl enable --now libvirtd
systemctl enable --now virtlogd
2. Установка и настройка noVNC
Для организации доступа к виртуальной машине через веб-интерфейс устанавливается проект noVNC. Для этого клонируются репозитории noVNC и websockify:
git clone https://github.com/novnc/noVNC.git /opt/noVNC
git clone https://github.com/novnc/websockify /opt/noVNC/utils/websockify
После клонирования создаётся символическая ссылка для доступа к клиентской части VNC через файл index.html:
ln -sf /opt/noVNC/vnc.html /opt/noVNC/index.html
3. Подготовка образов установочных ISO и создание виртуального диска
Создаются необходимые директории для хранения образов операционных систем и виртуальных дисков:
mkdir -p /var/lib/libvirt/images/
mkdir -p /var/lib/libvirt/isos/
Загрузка установочного образа Windows 10
Образ Windows 10 может быть загружен посредством утилиты wget с другого сервера или перенесён на целевой сервер заранее. В скрипте в строке:
WINDOWS_ISO_URL="https://example.com/windows10.iso" # Замените URL на фактический
Необходимо указать корректную ссылку на ISO-образ. В качестве примера загрузки использован следующий образ (тестировался на Ubuntu 22.04): https://torrent.libreseed.icu/SHA-1/5337bb57bd672d6bf2282379a8f52e42100312c4
Либо, поместите образ на сервер заранее и пропустите шаг загрузки wget -O.
Загрузка драйверов VirtIO
Для корректной работы системы рекомендуется загрузить ISO-образ с драйверами VirtIO для Windows:
wget -O /var/lib/libvirt/isos/virtio-win.iso https://fedorapeople.org/groups/virt/virtio-win/direct-downloads/stable-virtio/virtio-win.iso
Создание виртуального диска
Виртуальный диск для ВМ создаётся с использованием формата qcow2 и размером 60 Гб:
qemu-img create -f qcow2 /var/lib/libvirt/images/win10.qcow2 60G
4. Определение и настройка виртуальной машины
Для развертывания ВМ создаётся XML-конфигурация, в которой задаются основные параметры: имя виртуальной машины, объём оперативной памяти (в примере 4 ГБ), количество виртуальных процессоров (2 vCPU) и параметры загрузки (с приоритетом CD/DVD, а затем жесткая копия).
В конфигурации определяются следующие устройства:
-
Три виртуальных диска: – основной диск для системы; – загрузочный образ Windows 10; – образ с драйверами VirtIO.
-
Сетевой адаптер с моделью e1000.
-
Параметры графического вывода через VNC (порт 5900) с доступом через noVNC.
-
Дополнительные контроллеры, USB-контроллер, последовательные порты и прочие компоненты, необходимые для полноценной работы ГУИ и инфраструктуры гипервизора.
Сохранённый XML-файл, например, во временной директории, применяется командой virsh define для регистрации ВМ, после чего она запускается:
virsh define /tmp/win10_vm.xml
rm /tmp/win10_vm.xml
virsh start win10
5. Настройка noVNC для доступа к виртуальной машине
Для обеспечения удалённого доступа создаётся скрипт запуска noVNC:
cat > /usr/local/bin/start_novnc << EOL
#!/bin/bash
cd /opt/noVNC
./utils/novnc_proxy --vnc 127.0.0.1:5900 --listen 0.0.0.0:6080
EOL
Необходимо сделать данный скрипт исполняемым:
chmod +x /usr/local/bin/start_novnc
Далее создаётся unit-файл для systemd, который будет автоматически запускать сервис noVNC:
cat > /etc/systemd/system/novnc.service << EOL
[Unit]
Description=noVNC Service
After=network.target
[Service]
Type=simple
User=root
ExecStart=/usr/local/bin/start_novnc
Restart=on-failure
[Install]
WantedBy=multi-user.target
EOL
После перезагрузки демона systemd сервис активируется и запускается:
systemctl daemon-reload
systemctl enable novnc
systemctl start novnc
6. Получение публичного IP-адреса и инструкция по доступу
Чтобы обеспечить удобство подключения, скрипт пытается получить публичный IP-адрес сервера с помощью утилит curl или команды ip. После установления службы, в консоли выводится инструкция для доступа к Windows:
-
Для входа в систему необходимо в веб-браузере открыть URL:
http://<ip>:6080/vnc.html
7. Заключительные замечания
-
Образ Windows. В строке установки WINDOWS_ISO_URL укажите корректную ссылку на образ Windows 10, либо заранее поместите его в /var/lib/libvirt/isos/windows10.iso и скорректируйте скрипт.
-
Ресурсы хоста и ВМ. В примере виртуальной машины выделено 2 vCPU и 4 ГБ оперативной памяти. При наличии достаточных ресурсов хост-системы вы можете увеличить параметры.
-
Виртуализация. Убедитесь, что выбранный вами хостинг-провайдер поддерживает виртуализацию внутри виртуализации (nested virtualization).
Данное решение является универсальным и может быть адаптировано под различные требования и версии Windows. Надеюсь, что представленная инструкция поможет вам быстро и качественно развернуть Windows 10 на сервере Ubuntu с удобным веб-доступом через noVNC.
Автор статьи благодарит Timeweb за предоставленную возможность развертывания проекта и рекомендует использовать данный сервис для стабильной работы виртуальных машин.
Looking to run a Windows 11 virtual machine on your Linux desktop or laptop but don’t know how? We can help! Follow along with this guide as we go over how you can run Windows 11 in a virtual machine on Linux.
Setting up VirtualBox on Linux
VirtualBox is a free virtualization tool for Windows, Mac OS, Linux, BSD, and other platforms. It is the perfect tool to run a Windows 11 VM on Linux. However, you’ll need to install it on your computer first.
To install VirtualBox on your Linux PC, open up a terminal window. You can open up a terminal window by pressing Ctrl + Alt + T on the keyboard. Or, search for “Terminal” in the app menu and launch it that way.
With the terminal window open and ready to use, follow the installation instructions below to get VirtualBox on your computer.
Ubuntu
To install VirtualBox on Ubuntu, use the apt install command.
sudo apt install virtualbox
Debian
On Debian, get VirtualBox working using the apt-get install command.
sudo apt-get install virtualbox
Arch Linux
On Arch Linux, the VirtualBox application can be installed using the pacman -S command.
sudo pacman -S virtualbox
Fedora
Those on Fedora will be able to install VirtualBox with the dnf install command (provided RPM Fusion is already configured.)
sudo dnf install VirtualBox
OpenSUSE
On OpenSUSE Linux, you’ll be able to install VirtualBox using the zypper install command.
sudo zypper install virtualbox
Downloading Windows 11 ISO
Like Windows 10, Microsoft is giving away Windows 11’s ISO for free. So, you’ll be able to grab a legit copy of Windows 11 for use in VirtualBox. To get your hands on the Windows 11 ISO, follow the step-by-step instructions below.
Step 1: Head over to the “Download Windows 11” page. Then, scroll down to “Download Windows 11 Disk Image (ISO)” and click on the “Select Download” menu.
Step 2: Inside the “Select Download” menu, choose “Windows 11” and click on the blue “Download” button.
Step 3: Upon choosing “Windows 11,” the page will ask you to “select the product language.” Choose the language you speak. Then, click on the blue “Confirm” button to continue.
Creating your Windows 11 VM
With the Windows 11 ISO downloaded, it is time to create the VM. To make your virtual machine, launch VirtualBox and follow the step-by-step instructions below.
Step 1: Find the blue “New” button in the VBox UI and click on it with the mouse to create a new VM. Then, type “Windows 11” in the “Name” box.
Step 2: On the next page, you’ll be asked to choose the memory size. By default, the size is 4 GB. Leave it as is, or increase it if you know your machine can handle the load.
Step 3: On the “Hard disk” page, click on the “Create a virtual hard disk now” button. Then, click “Create” to move to the next page. Be sure to select “VDI (VirtualBox Disk Image”) as the file format.
Step 4: After choosing VDI as the drive format, select the “Dynamically allocated” option. Then, on the next page, click the “Create” button to make your drive. The default size is 80, but you can increase this if necessary.
Step 5: Select the VM and click on the green “Start” button to turn it on. Once on, select the Windows 11 ISO file and select the “Start” button to load the ISO.
Step 6: Once the VM has started up, you’ll see a message that says, “Press any key to boot from CD.” Select the VM with the mouse, then press a button on the keyboard to start up the Windows 11 installer.
Step 7: Inside the Windows 11 installer, you will need to do some modifications to install. As VirtualBox doesn’t support TPM, you’ll have to shut it off in the registry. You’ll also have to shut some other things down too.
Press Shift + F10 on the keyboard in the Windows 11 installer to bring up the command prompt. Then, type in regedit and press Enter.
Step 8: Inside of the registry editor, navigate to “HKEY_LOCAL_MACHINE\SYSTEM\Setup.” Then, right-click on the “LabConfig” folder with the mouse. Click “New” followed by the “key.” Name the key “LabConfig.”
Step 9: Click on the “LabConfig” key (aka folder). Then, right-click on the blank white space and select “New” followed by “DWORD (32-bit) Value”. You must create three new “DWORD (32-bit) Value” entries in the “LabConfig” area.
These values must be:
- BypassTPMCheck
- BypassRAMCheck
- BypassSecureBootCheck
Step 10: Select each of the values with the mouse, right-click on them and choose the “Modify” option. Change the value from “0” to “1”. Then, close the registry editor and the command prompt.
Step 11: Continue on with the Windows 11 installation. When the process is complete, you’ll have a Windows 11 virtual machine set up in VirtualBox.
В этом подробном руководстве для новичков показано, как установить Windows 10 в VirtualBox в Linux.
Я регулярно призываю людей использовать Linux, и когда я даю основания переключиться на Linux, я всегда упоминаю, что они могут использовать Windows и Linux вместе, если они «боятся Linux».
Содержание
- Давайте поговорим о том, как пользоваться VirtualBox
- Что такое VirtualBox и каковы его преимущества
- Установите Windows 10 в VirtualBox в Ubuntu и Linux Mint
- Шаг 1: Загрузите Windows 10 ISO
- Шаг 2. Установка VirtualBox в Ubuntu и Linux Mint
- Шаг 3. Установка Windows 10 в VirtualBox
- Что делать если Windows не запускается
- Ваше впечатление от этой программы
- Установка Ubuntu в VirtualBox
- Выберите язык установки
Давайте поговорим о том, как пользоваться VirtualBox
Одним из способов совместной работы двух ОС является двойная загрузка Windows и Linux. Он отлично работает, за исключением того, что вам нужно переключиться между операционной системой, перезапустив систему. Это неудобно в определенной степени.
Если вы, как и я, тоже нечасто являетесь пользователем Windows и не хотите беспокоиться о двойной загрузке Ubuntu и Windows 10, я предлагаю установить Windows 10 в Linux, создав виртуальную машину. В предыдущем учебном пособии я показал вам, как установить VMWare в Ubuntu, но в этом учебнике мы будем использовать Oracle VirtualBox для создания виртуальных машин для установки Windows 10.
Что такое VirtualBox и каковы его преимущества
VirtualBox — это программное обеспечение для виртуализации с открытым исходным кодом от Oracle для создания виртуальных машин. С помощью виртуальной машины вы можете запускать операционную систему, такую как приложение в вашей текущей операционной системе. Это как компьютер внутри компьютера.
Они называются виртуальными машинами, потому что они в основном имитируют другую операционную систему, но на самом деле они не взаимодействуют с системой, как настоящая операционная система.
Суть в том, что с помощью программного обеспечения для виртуальных машин вы можете использовать Windows, как приложение в Linux. В отличие от обычных приложений, он будет потреблять много оперативной памяти. Таким образом, вы можете использовать программное обеспечение и программу для Windows в Linux, без необходимости установки Windows в целом.
Установите Windows 10 в VirtualBox в Ubuntu и Linux Mint
Перед установкой Windows 10 в VirtualBox давайте посмотрим, что вам нужно заранее:
- Подключение к Интернету с хорошей скоростью для загрузки операционной системы Windows 10 ISO
- Не менее 4 ГБ оперативной памяти. Чем больше RAM вы получили, тем лучше.
- Около 20 ГБ свободного места для установки Windows 10
После того, как вы убедитесь в предварительных условиях и требованиях, давайте посмотрим, как пользоваться VirtualBox. Для наглядного примера, мы установим Windows 10 в VirtualBox на Ubuntu.
Шаг 1: Загрузите Windows 10 ISO
Первым и главным шагом является загрузка Windows 10 ISO. Вы можете загрузить Windows 10 32-bit или 64-bit, в зависимости от вашей системы. Перейдите по на официальный сайт Microsoft и выберите, какую версию Windows 10 вы хотите скачать:
- Вам нужно будет выбрать издание, язык, а затем выбрать между 32-битной или 64-битной системой, прежде чем загружать ISO.
Шаг 2. Установка VirtualBox в Ubuntu и Linux Mint
VirtualBox доступен по умолчанию в Ubuntu и Linux Mint. Установить это очень просто. Все, что вам нужно сделать, это использовать следующую команду:
sudo apt-get install virtualbox
Шаг 3. Установка Windows 10 в VirtualBox
Сейчас мы расскажем вам наглядно, как пользоваться VirtualBox на Ubuntu или Linux Mint. Должен сказать, то, что установка Windows 10 в VirtualBox очень быстрая. Конечно все зависит от производительности вашего устройства, но если оно современное, то, это займет несколько минут. Давайте разберем все более подробно.
Запустите VirtualBox. Вы должны увидеть экран, подобный приведенному ниже. Нажмите на кнопку «Далее»:
Назовите VM все, что стоит запомнить. Также выберите операционную систему и версию, в этом случае для Windows 10 и 64 бит для меня.
Выберите размер ОЗУ. Рекомендуемый размер оперативной памяти для 64-битной Windows 10 составляет 2 ГБ, а для 32-битной Windows 10 — 1 ГБ. Но я предлагаю немного больше установить значение, чем нужно для более плавного опыта.
Следующее это размер места для виртуальной машины. Если вы хотите хорошей производительности то не скупитесь в пространстве, выберите рекомендуемый размер или больше, стандартное значение у вас будет немного больше рекомендуемого размера.
Для формата используйте формат VDI.
Смутно понимаете главную разницу в динамическом или фиксированном размере? Если вы выберете динамический, установленная VM позже вырастет из выделенного размера. Если вы не собираетесь широко использовать Windows, я предлагаю пойти с фиксированным размером.
Завершите работу вокруг установки. Вы можете выбрать, где создать виртуальный диск. Место по умолчанию (домашний каталог) также будет работать.
Вы должны вернуться к началу экрана. Но подождите, мы еще не использовали нашу Windows 10 ISO, не так ли? Сейчас настало время использовать ISO. Нажмите «Настройки».
Здесь перейдите в Storage и добавьте новый оптический дисковод. Я добавил этот снимок экрана позже, потому что у нескольких читателей были трудности с его поиском.
Выберите «Диск» и укажите «Windows 10 ISO».
Теперь вы должны увидеть Windows 10 ISO, перечисленные в разделе «Хранение». Нажмите OK.
Вы должны вернуться к главному экрану Oracle VirtualBox. Теперь у вас все готово. Следующим шагом будет установка Windows 10. Нажмите «Пуск» на главном экране:
Вуаля !! Вы должны увидеть знакомый экран загрузки Windows:
Через пару секунд вы увидите возможность установки Windows:
Примечание. В это время, если вы видите логотип Windows с черным фоном и он не запускается, вам, возможно, придется немного подкорректировать настройки.
Что делать если Windows не запускается
«Кажется, что существует несовместимость между Virtualbox и Windows 10 1703. Виртуальная машина, которая работает с W10 1607, не сможет загрузиться W10 1703 -UNLESS- установлен следующий параметр: В разделе «Ускорение системы» вы должен установить Paravirtualization в None, а затем перезагрузиться».
Я думаю, что вы можете справиться с этим, поскольку установка Windows — это всего лишь несколько кликов. Для вашего удобства я добавляю скриншоты в галерею. Нажмите на изображение, чтобы увеличить их, если вам нужно сделать подсказку.
После того как вы успешно установили Windows 10, вы обнаружите, что интернет-соединение также используется совместно с виртуальными Windows. Нет необходимости в дальнейшей настройке.
Когда вы закончите использовать виртуальную Windows, вы можете вернуться на главный экран и отключить виртуальную Windows:
Чтобы снова запустить виртуальную ОС, снова нажмите «Пуск» (зеленая стрелка) на главном экране VirtualBox. Это оно. Подробнее об использовании виртуальной ОС позже. Я думаю, это дает вам хорошее представление о том, как установить Windows в Linux Mint на первом месте 🙂
Надеемся вы поняли, как пользоваться VirtualBox, но также стоит сказать, что еще мы рассказывали про похожие программы виртуализации для Ubuntu.
Ваше впечатление от этой программы
Помогло ли это учебное пособие установить Windows в Linux с помощью VirtualBox? Если у вас есть вопросы о том, как пользоваться VirtualBox или предложения по улучшению, не стесняйтесь оставить комментарий.
Установка Ubuntu в VirtualBox
Ubuntu теперь загрузится в живую версию операционной системы и появится приветственное сообщение.
Вам будет предложено выбрать ваш язык, и вы сможете выбрать, попробовать ли Ubuntu или установить Ubuntu.
Если вы решите сначала попробовать Ubuntu, вы всегда можете запустить установщик, дважды щелкнув значок «Установить» на рабочем столе Ubuntu.
Выберите язык установки
Теперь мы входим в настройку установки Ubuntu.
Первым шагом является выбор языка установки.
- Выберите язык
- Нажмите «Продолжить»
- Предварительные условия
- Появится экран, показывающий, как вы подготовлены к установке Ubuntu.
Убедитесь, что если вы используете ноутбук, который подключен к компьютеру или имеет достаточное время автономной работы. Я рекомендую вам подключиться к источнику питания, особенно если вы планируете устанавливать обновления по мере поступления.
В нижней части экрана есть два флажка.
- Выберите, нужно ли устанавливать обновления по мере поступления
- Выберите, устанавливать ли стороннее программное обеспечение
- Если у вас достаточно быстрое подключение к Интернету, стоит поправить, как вы идете, но если вы этого не сделаете, я бы порекомендовал установку Ubuntu и обновление позже.
Я бы также рекомендовал не устанавливать стороннее программное обеспечение на этом этапе. Это можно сделать после установки.
- Нажмите «Продолжить».
Перевод из отличного английского ресурса itsFoss.
В этой статье мы рассказали вам о том, как пользоваться VirtualBox. Надеемся статья была полезной для вас. Если остались вопросы — пишите их в комментариях.
Также, поделитесь ссылкой в социальных сетях.
1. Overview
If you are using a Linux environment but want to run a Windows 11 virtual machine, you can easily do so using LXD. Windows 11 is somewhat strict in its requirements (needs UEFI SecureBoot, having a TPM, and having a modern CPU), but LXD supports that out of the box, and there’s no need for any complex configuration in order to enable a Windows VM. In this tutorial, we will walk through the process of installing Windows in an LXD virtual machine. We will be installing Windows 11, but the same procedure also applies to Windows server machines.
What you’ll learn
- How to repackage an ISO image with lxd-imagebuilder
- How to install a Windows VM
What you’ll need
- Ubuntu Desktop 20.04 or above
- LXD snap (version 5.0 or above) installed and running
- Some basic command-line knowledge
2. Prepare your Windows image
To start, we need to download a Windows 11 Disk Image (ISO) from the official website.
To proceed with the installation, we need to prepare the downloaded image, by repackaging it with a tool called lxd-imagebuilder. lxd-imagebuilder is an image-building tool for LXC and LXD, used to build all our official images.
First, we need to install lxd-imagebuilder
sudo snap install lxd-imagebuilder --classic --edge
Then we need to locate our downloads directory and find our Windows 11 ISO file
cd Downloads/
ls WindowsIsoImage.iso
We can then repackage the file, and give it a new file name (let’s call it “win11.lxd.iso”)
This needs to be run as root
sudo lxd-imagebuilder repack-windows WindowsIsoImage.iso win11.lxd.iso
ⓘYou might get a message “Required tool “hivexregedit” is missing” and “Required tool “wimlib-imagex” is missing”. You can easily install all the needed dependencies using the following command:
sudo apt-get install -y --no-install-recommends genisoimage libwin-hivex-perl rsync wimtools
ⓘYou might also get a message “failed to create overlay” depending on the file system you use. This does not hinder the process, rather it will just do things the alternative way which may take a few min longer
The result is a new ISO image that will work seamlessly with LXD.
We can now locate the new ISO file
ls -lh win11.lxd.iso
3. Create a new VM
After we create the Windows image, We can create a new empty VM that we can call ”win11”
lxc init win11 --vm --empty
The default storage/disk provided to new VMs is 10GB, which is not enough for Windows so we need to increase the size of the disk to 50GB with the following command before proceeding
lxc config device override win11 root size=50GiB
We should also increase the CPU limits for optimal performance
lxc config set win11 limits.cpu=4 limits.memory=8GiB
Next, we need to add TPM (Trusted Platform Module) as it’s one of the things Windows requires. We can call it vtpm as it is a virtual TPM after all. Adding TPM will also enable you to enable things like bitlocker inside of your VM.
lxc config device add win11 vtpm tpm path=/dev/tpm0
The last thing we need to do is add the install media Itself and make it a boot priority (so it boots automatically).
lxc config device add win11 install disk source=/home/mionaalex/Downloads/win11.lxd.iso boot.priority=10
If you are doing this in a cluster, make sure to launch this commands on the same member where the targeted instance is placed. You can check this with lxc info win11
ⓘReplace /home/mionaalex/Downloads/ with your own path to the repackaged file
Now we can start the installer.
ⓘYou will need to manually provide a VGA console access by installing either remote-viewer or spicy. If neither of these is found in the system, you will get a message instructing you to install them.
lxc start win11 --console=vga
If needed, install a Spice client as prompted:
sudo apt-get install -y --no-install-recommends virt-viewer
Or
sudo apt-get install -y --no-install-recommends spice-client-gtk
The rest of the installation will proceed automatically.
4. Install Windows
You should now see the Windows installer screen.
You can select “I don’t have a key” (or add a key if you have one), select Windows 11 Pro, select the option Custom: Install Windows Pro only (Custom/advanced) and click install.
The installation will take some time.
Once the first stage is done, you will need to restart. That will close the terminal for the console, so you need to open it again.
lxc console win11 --type=vga
This will now look like a regular Windows installation process. You will see a boot window with “getting ready”. If it needs to reboot again, just run the command above.
You will get another standard setup screen, choose your options (date format, keyboard layout etc.) or skip through it.
Now it will look for updates. This will take some time.
Once completed, it will restart again so attach to the console again. The installer will show up once again and complete the process.
5. Additional information
Now you have your Windows 11 VM up and running, and you can use it in any way you’d like. For faster boots, the ISO can be removed once the installation process is over.
lxc config device remove win11 install
6. That’s all
Now you’ve learned how you can set up and run a Windows 11 virtual machine using LXD. Additional information on how to do image repacking with lxd-imagebuilder can be found here.
If you’d like to watch a video walk-through, you can find it here.
If you’d like to read more about LXD virtual machines, read this blog.
For more about LXD in general, take a look at the following resources:
-
LXD webpage
-
Documentation Page
If you have further questions or need help, you can get help here:
- Discussion forum
Was this tutorial useful?
Thank you for your feedback.
(Image credit: Windows Central)
If you’re looking to try out some alternative operating systems like Linux, it’s pretty straightforward to do so on Windows 10 and 11 inside a virtual machine.
The reverse is also true. If you’re using Linux on your desktop or laptop, it’s incredibly easy to install Windows 10 inside a virtual machine giving you full access to Microsoft’s desktop OS. Though, admittedly, there are a couple of extra steps involved in most cases with Windows 11 thanks to some of its new requirements.
Here’s what you need to know about getting set up.
About this guide and installing VirtualBox
There are naturally several different Linux distros out there that look and operate a little differently from one another. Still, the steps here are fairly universal and should be suitable for a wide range.
We’ll be using VirtualBox to handle the virtual machine on Pop!_OS and Linux Mint, both of which are based on Ubuntu. VirtualBox has downloads for most major distros on its site, while some like Manjaro may need some more specific steps.
Before you begin you’ll need to download and install VirtualBox and grab the latest Windows 10 64-bit ISO or the latest Windows 11 64-bit ISO.
How to install Windows 10 and 11 in VirtualBox
Once you have VirtualBox installed on your Linux system, the setup and installation process for a Windows virtual machine takes only a matter of minutes.
All the latest news, reviews, and guides for Windows and Xbox diehards.
- Open VirtualBox.
- Click on new.
- Enter a name to identify your virtual machine, in this case Windows 10.
- Make sure the type dropdown box says Microsoft Windows.
- Make sure the version dropdown box is for Windows 10 (Windows 11 isn’t yet specified but works with Windows 10).
- Choose how much RAM you want to allow your virtual machine to use. Generally speaking, the more, the better.
- At the next screen make sure the box marked create a virtual hard disk now is checked.
- Check the VDI (VirtualBox Disk Image) box.
- Decide whether you want a dynamic or fixed hard drive for your virtual machine based on your own system and needs. Here we’re going with a fixed drive.
- Choose how much storage space you wish to allocate your virtual machine. Generally speaking the more the better, and 64GB is a good starting point if you can spare that much.
- Click create.
VirtualBox will now create the container you need to install Windows and run it as a virtual machine. Now, you’re ready to actually get into the Windows installation process.
Click the big green start in your VirtualBox window, and when the box above appears, simply select the ISO you downloaded for Windows 10 or Windows 11 as the startup disk. When you click the start button now, VirtualBox will fire up a virtual PC for you to use and will begin the Windows install process just as you might see when installing natively on a PC.
From here, you simply need to go through the Windows install process, and once everything is completed and you’re logged in, you will be staring at a fully operational Windows PC inside a window on your Linux machine. Windows 10 will install without a hitch, but there’s a good chance you need to complete some additional steps for Windows 11.
Bypassing Windows 11 installation errors
Whichever virtual machine tool you’re using to install a Windows 11 VM with on Linux there’s one thing you’re more than likely going to come up against: an error saying your PC can’t install it.
This is down to two key Windows 11 hardware requirements: TPM 2.0 and Secure Boot. Some VM software, such as VMware, can handle the Secure Boot aspect, but VirtualBox, for example, cannot. Likewise, some can inject a virtual TPM, but most, again like VirtualBox, cannot currently.
So, we’ll just tell our VM to skip those checks. When you reach the error screen, hit Shift + F10 to open a Command Prompt and enter the following two commands.
REG ADD HKLM\SYSTEM\Setup\LabConfig /v BypassTPMCheck /t REG_DWORD /d 1REG ADD HKLM\SYSTEM\Setup\LabConfig /v BypassSecureBootCheck /t REG_DWORD /d 1
This will add the necessary instructions into the registry to skip checks for both TPM and Secure Boot. Close the Command Prompt, go back one step, then continue as normal and you’ll be able to complete the Windows 11 installation process.
Alternatives to VirtualBox
Linux being as broad as it is, there are, of course, options when it comes to virtual machine software. For the purposes of this guide, I’ve focused on VirtualBox in part because it’s just easy to set up and rarely seems to have issues.
It’s not the most elegantly designed piece of software, though, and there are certainly alternatives available. Some of those include GNOME Boxes QEMU, and Virtual Machine Manager (pictured above), though, in my experience, GNOME Boxes has been a little unreliable with Windows.
There is also a version of VMware Workstation for Linux, though this can be a bit tricky to install on some distros, and it’s not open source, which goes against what many Linux users would wish to use.
Whichever you choose, though, getting a Windows 10 or 11 virtual machine running on Linux is a relatively simple process, whatever it is you need it for.
Richard Devine is a Managing Editor at Windows Central with over a decade of experience. A former Project Manager and long-term tech addict, he joined Mobile Nations in 2011 and has been found on Android Central and iMore as well as Windows Central. Currently, you’ll find him steering the site’s coverage of all manner of PC hardware and reviews. Find him on Mastodon at mstdn.social/@richdevine