Want to download MS Windows iso image from Linux or macOS? This script can do the job via single command!
Without opening web browser and visiting MS website, or even without a graphical desktop environment, this free and open-source script, Mido, can help downloading a Windows disco images.
It uses Microsoft’s (reverse engineered) proprietary downloading API! And, all the downloads are sourced from official Microsoft servers.
The script interacts with the Microsoft’s API, to grab the latest release of Windows and generate a fresh download link, which is valid for 24 hours. Then it starts downloading the iso image via that link.
So far, the script supports downloading following Windows disco images:
- Windows 7 Ultimate x86_64.
- Windows 8.1 x86_64.
- Windows 10 x86_64.
- Windows 11 x86_64.
- Windows 8.1 Enterprise Evaluation.
- Windows 10 Enterprise Evaluation.
- Windows 11 Enterprise Evaluation.
- Windows 10 Enterprise LTSC Evaluation.
- Windows Server 2008 R2.
- Windows Server 2012 R2 Evaluation.
- Windows Server 2016 Evaluation.
- Windows Server 2019 Evaluation.
- Windows Server 2022 Evaluation.
All the downloads are for English (United States). For other language, user can configure it after installed Windows into machine.
Besides generating link and downloading iso image, the script also support download resumption, and SHA-256 checksum verification. And, user can download many different Windows versions in a single command.
Get Mido & Download Windows
Mido is a free and open-source project hosted on Github. Before getting started, you may first check HERE to see the project status.
1. To get start, first open terminal or connect to your Linux server from console.
2. Then, download the script via command:
wget https://raw.githubusercontent.com/ElliotKillick/Mido/main/Mido.sh
For Debian/Ubuntu, run sudo apt install wget
if the command says ‘wget’ not found.
3. Once you got the script, run command to add executable permission:
chmod u+x Mido.sh
4. For the first time using the script, you may just run the command below to get help:
./Mido.sh
5. As the last screenshot shows, you can just run the command below to start downloading an iso (for example, windows 11)
./Mido.sh win11x64
You may replace win11x64
, with one of win7x64-ultimate, win81x64, win10x64, win81x64-enterprise-eval, win10x64-enterprise-eval, win11x64-enterprise-eval, win10x64-enterprise-ltsc-eval, win2008r2, win2012r2-eval, win2016-eval, win2019-eval, win2022-eval
. Or, use more than one (separate with space) to download them with single command.
For example, download Windows 11, Windows 11 Enterprise Evaluation, and Windows Server 2019 Evaluation, the 3 images via single command:
./Mido.sh win11x64 win11x64-enterprise-eval win2019-eval
Though, it seems to download them one by one in turns rather than in parallel.
DigitalOcean droplets do not accept .iso as an image file. We will install (windows server) Windows 10 on DigitalOcean droplet with the uploaded image file. We will also install windows on DigitalOcean on the virtual server first.
I will try two different methods for this.
1- Install the server with the Windows image that we will install on Virtualbox locally.
2- Install the server with the Windows image installed on the DigitalOcean droplet ubuntu qemu virtualization application.
Creating DigitalOcean Windows 10 image
We’re constructing a high-performance droplet. Let’s go with Ubuntu as our distribution.
I chose a shared CPU for more convenience. As a data center, I choose Frankfurt because it is closer to my current location.
I chose “imageserver” as the hostname – important to remember later.
I am using Putty to connect to the server. If you don’t have it on your computer, you can use the DigitalOcean console.
When connecting to the server with Putty, I recommend setting the following setting to avoid timeout during extended operations. In the “Connection” tab.
We set “Seconds between keepalives” to 10.
The “Disable Nagle’s Algorithm” checkbox must be selected.
The “Enable TCP Keepalives” box must be selected.
Now we need to keep these settings as default. So this setting will take effect every time we open Putty.
Make sure “Default Settings” is selected under “Saved Sessions”. We save the settings by clicking “Save”.
Using Putty, we connect to the server with the username “root” and set the password.
We are updating server packages.
apt-get update
We are installing the Qemu packages that we will use for virtualization.
apt install -y qemu-utils && apt install -y qemu-system-x86
We create an IMG file format with Qemu. We will use this file as the virtualization disk.
You can replace 32G with a size that suits you. Attention, the larger you choose, the longer the process takes. Let me remind you.
qemu-IMG create -f raw windows10.img 32G
the result of the process should be like this. The process takes a short time,
Formatting ‘windows10.img’, fmt=raw size=34359738368
We will need these drivers as we will be using a virtual server. We are downloading.
wget https://fedorapeople.org/groups/virt/virtio-win/direct-downloads/stable-virtio/virtio-win.iso
Now we need the iso file for DigitalOcean Windows 10 installation. We will download it from the Microsoft site.
We continue by saying download the tool from the site in the link.
We run the downloaded application. We continue with the option “Installation media for another computer”.
You can leave the settings like this,
We choose “ISO file” as the media to be used. We continue.
When the download is complete, we upload the ISO file to one of the cloud storage applications such as google drive, dropbox and get the link. Make sure it’s “Anyone with this link can view”.
wget -O windows.iso https://www.dropbox.com/s/1yy3httsy3oo4kv/windows.iso?dl=0 -the link you created
The ISO files you can find on the internet may contain malicious software. Do not trust the windows 10 iso links you see on the internet. You download it from the Microsoft site and upload it to the cloud yourself, and set up your server in this way.
Now we will virtualize. We will use the Windows10.img file as the hard drive. We will use the windows.iso file as cd/dvdrom.
We will also make it accessible as vnc. Instead of 7G, you should write a value slightly lower than the RAM of the (imageserver) server you have installed. For example, since my server is 8G, I reserved 7G for virtualization.
qemu-system-x86_64
-m 7G
-CPU host
-enable-KVM
-boot order=d
-drive file=windows.iso,media=cdrom
-drive file=windows10.img,format=raw,if=virtio
-drive file=virtio-win.iso,media=cdrom
-vnc :0
After pasting the code, you have to press enter twice. The standby screen should look like this.
Now we will connect with VNC. I used RealVNC company’s VNC Viewer application. RealVNC can download it here.
We connect to the virtualization software from the VNC Viewer application with our IP address.
If you get an encryption warning like this, you can say continue.
Now we reach the installation screen. If you see a black screen, wait. It may take time for this screen to appear.
Mouse synchronization can be a bit of a hassle. If it’s too bad, the keyboard’s tab, arrow keys, and enter key will suffice instead.
If the language options are suitable, we say next.
Let’s continue with the download now.
If you have a product key, enter it; if not, we continue by saying, “I don’t have a product key”.
We select the appropriate operating system and click next.
Select the “I accept the license terms” box and click “Next”.
We continue with the option “Custom: Install Windows only (advanced)”.
Select the Install driver option. Setup cannot display the disk because the disk driver is not loaded.
It would be best to uncheck the “Hide drivers incompatible with this computer hardware” box. Then click the “Browse” button.
We will install the drivers included in these two files.
E:NetKvmw10amd64
E:viostorw10amd64
We installed the ethernet driver.
We have installed the SCSI Controller driver.
Now we press the “new button” and say “apply” to use our disk correctly.
We say okay to this warning.
Now we select our disk and click next.
This step may take a while.
We have completed the pre-installation of DigitalOcean Windows 10.
Tick the “Settings for personal use” option and press the “Next” button.
We click on the “Offline account” option at the bottom left on this screen. (You can enter if you have a Microsoft account instead)
We can continue by clicking on the “Limited experience” option at the bottom left.
Let’s choose a name and click the “Next” button. On the next screen, let’s select our password and continue.
We can continue by clicking the “Accept” button.
We can continue by clicking the “Skip” button.
Installation is complete.
Now we go back to Putty to stop virtualization. And we press the “CTRL + C” keys. This key combination is used to control the current process in Linux.
Now we compress our windows10.img file. We do this because the size of our windows10.img file is too large. (32GB in my example)
Since most of this file is empty, we compress it smaller. The compression process may take some time.
The dd command is used for backup. We show the source with the if parameter. Our target is windows10.gz.
We compress the data and copy it from the destination to the source using the gzip command. The gzip -c option secures the head without removing it.
The gzip -1 parameter, on the other hand, is used to compress with maximum speed and minimum compression. We use 1 because our file size is large. If we do not write 1, the default value is 6. We can use a maximum compression value of 9.
dd if=windows10.img | gzip -c -1> windows10.gz
This process takes some time. It took me about 8 minutes. You can see the screen you will see when it is completed below. The compressed file is 5.5 GB in size.
We start HTTP.server to transfer our windows10.gz file to the setup server. So we will be able to download it from this link: http://139.59.150.43:8000/windows10.gz.
python3 -m HTTP.server
Installing windows 10 on digitalocean with the uploaded image file
Now let’s prepare the server where we will install Windows. You can see sample settings below.
We come to the recovery tab of the Windows Droplet we opened. We activate the “Boot from Recovery ISO” option.
Then press the “on” button in the upper right.
We pass the warning by pressing the “Turn off” button.
We turn the server back on by pressing the “Off” button.
Now we click on the “Recovery Console” button on the same screen.
We will encounter this screen. Type 6 and press enter.
We will download the windows10.gz file to the server; we prepared it using the wget command. We will unzip the file with Gunzip. Then we will write the image to dev/vda disk with dd.
wget -O- http://imageserver:8000/windows10.gz | gunzip | dd of=/dev/vda
wget -O- http://139.59.150.43:8000/windows10.gz | gunzip | dd of=/dev/vda
Process completed.
We will put the server back into “Boot from Hard Drive” mode. We will turn off the server by pressing the “ON” button. After closing, we will turn it back on by pressing the “OFF” button.
Now we will click on the “Launch Recovery Console” button under the “Access” tab to access the server.
Windows booted normally.
We no longer need the imageserver server. Go to the Imageserver droplet and click “Destroy this Droplet” from the “Destroy” tab. We continue the warning by saying “confirm”.
Now we will configure the network settings of the server. Click on the network icon at the bottom right of the screen. Then click the “Network & Internet settings” button.
Then click on the “Ethernet” tab.
Click on “Change adapter options”.
Right-click on an adapter and click “Properties”.
Double-click on “Internet Protocol Version 4 (TCP/IPv4)”.
We fill in the IP addresses using the information written at the bottom of the screen. Enter the DNS addresses 1.1.1.1 and 8.8.8.8 and click the “OK” button.
We are now connected to the internet.
Now we will make the necessary settings to make a remote desktop. At the start, we will write “remote desktop settings”. It’s okay if no Turkish characters appear; type “remote table,” and you will see it in the results.
We click on the switch that says “Off” to enable remote desktop. We continue the warning by saying, “Confirm”.
Click on “Advanced settings” from the same screen.
We’re removing the box in front of “Computers require Network Level Authentication to connect (recommended)”. We continue the warning by saying, “Proceed anyway”.
Now we can connect to the server with Microsoft’s own remote desktop software.
You can download the software here.
We press the “Add” and then the “PC” buttons in the upper right corner of the software.
We enter our IP address and click save.
Now we can use our server.
#!/bin/bash # Specify the Windows 10 ISO to download WIN10_ISO_URL="https://software-download.microsoft.com/download/pr/19043.1165.210529-1541.co_release_CLIENT_CONSUMER_x64FRE_en-us.iso" # Download the Windows 10 ISO wget -O /var/lib/vz/template/iso/Windows10.iso $WIN10_ISO_URL # Create a new VM in Proxmox qm create 9000 --name Windows10 --memory 4096 --cpu host --net0 virtio,bridge=vmbr0 # Add a SATA hard drive to the VM qm set 9000 --scsihw virtio-scsi-pci --scsi0 /var/lib/vz/images/9000/vm-9000-disk-0.qcow2,ssd=1,size=100G # Attach the Windows 10 ISO to the VM's CD/DVD drive qm set 9000 --ide2 /var/lib/vz/template/iso/Windows10.iso,media=cdrom # Set the VM to use the "kvm64" CPU type qm set 9000 --cpu kvm64 # Enable the QXL display driver for improved performance qm set 9000 --vga qxl # Add a Spice console to the VM for remote desktop access qm set 9000 --spicehw virtio-vga --spiceport 5900 --password mypassword # Set the SMBIOS UUID to a unique value for each VM qm set 9000 --smbios1 uuid=$(uuidgen) # Start the VM qm start 9000
This script first downloads the Windows 10 ISO image from the Microsoft website using the URL provided in the Proxmox wiki. It then creates a new VM in Proxmox with 4GB of memory and a 100GB virtual hard drive.
The script sets the CPU type to «kvm64,» which is recommended for better performance on modern CPUs. It also enables the QXL display driver for improved graphics performance, adds a Spice console for remote desktop access, and sets the SMBIOS UUID to a unique value for each VM.
Please note that you should replace «mypassword» in the —password parameter with a secure password of your choice. Additionally, you may need to adjust the VM parameters, such as CPU, RAM, and storage allocation, based on your specific needs.
Уровень сложностиПростой
Время на прочтение5 мин
Количество просмотров5.7K
В данной статье описывается пошаговая методика развертывания виртуальной машины (ВМ) с установленной операционной системой 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 за предоставленную возможность развертывания проекта и рекомендует использовать данный сервис для стабильной работы виртуальных машин.