If you live in a Linux-only or a Mac-only household, sooner or later you’ll find yourself in a situation where you need to run a Windows-only application. Like, for example, an obsucre BIOS editing utility that does run through Wine, but won’t actually output a valid BIOS file. Now if you’re a tech savvy person, your first thought would probably be to set up a virtual machine. And that’s easy enough You just have to install and configure a hypervisor Find the right settings for the VM Procure a trustworthy Windows ISO [unintelligible] But what if I told you that you can run a full copy of Windows… in a docker container? Yes, you heard that right – a full copy of Windows with shared storage, RDP and optional VLAN networking in a Docker container. And the best part – you won’t even need to go through the dreaded installation process This container, made by a Github user Kroese, automates every aspect of installing and configuring a fresh copy of Windows, You just run the container, and in a few minutes, you get a full copy of Windows that you can access right from your browser. So in this video, we’re gonna go through this docker container, aptly named windows, and see how well it runs such demanding AAA titles as Minesweeper and Pinball. Speaking of containers, if your pant pockets can’t contain your bulky wallet, you need the help of today’s sponsor, Ridge. Ridge makes super compact and pocket-friendly wallets that can fit up to 12 cards and still have room for cash. The Ridge wallets are made of premium materials, such as Ceramic, Titanium and Leather, and come with RFID-blocking plates to prevent skimming Each wallet comes with lifetime warranty and a 365 day risk-free trial – so if you don’t love your new wallet – you can send it back for a full refund. And if you also want to declutter your keychain – Ridge offers a variety of clip on keycases, which can fit up to 6 keys, and clip on your pant pockets for easy access. Right now, Ridge is celebrating their 11th anniversary and giving you the best deals on their products So go to ridge. com/wolfgang and get up to 30% off through April 1st. Thank you Ridge for sponsoring today’s video, and now? let’s get back to running Windows in Docker! Alright, so I’ve just logged onto my Ubuntu 22. 04 server with SSH, and as you can see, I’ve already installed Docker using the official instructions at docs. docker. com Now if we want to run a simple Windows 11 instance, we can just copy the docker command from the container’s Github page, paste it here, and press Enter. Now let’s go to our browser, enter the IP address of our server, as well as colon 8006, and we should be able to monitor the entire installation process. The docker container is gonna download the Windows image from the Microsoft servers, and set everything up automatically. Finally, once the installation is complete, we should see the Windows desktop and be able to play some Mineswee… oh. Right, I forgot that there’s no Minesweeper in Windows 11. So how does it work? Is it magic? Well, the keen-eyed among you, might have noticed this parameter in our docker command – which passes through the /dev/kvm device into our container. KVM is the same technology used to run virtual machines in something like Proxmox So strictly speaking, we’re not running a Windows container here, we’re running a Linux container which sets up a Windows VM for us. So no, it’s not magic, and you still need hardware virtualization support, if you want to run Windows using this container. The real selling point here in my opinion, is the ease of use. since this Docker container basically automates all the annoying aspects of installing Windows – like configuring the VM, partitioning, initial setup, and so on. And since it’s still using the good old KVM under the hood, you basically have access to all the KVM features – such as USB and SATA passthrough, as well as setting hard limits on things like CPU cores and RAM. I didn’t get to testing things like PCIe passthrough, but to be honest, if you need PCIe passthrough, you might as well set up an actual VM. But let’s go back to our container. The WebUI that we’ve looked at earlier uses VNC for the screen output But VNC is pretty slow and has no audio and no clipboard functionality. Instead, we can use RDP to access our installation. So let’s go back to our command line, and stop our container by pressing control-c As you can see, it’s gonna gracefully shutdown our VM Then, let’s create a folder for our docker-compose project, and also create a compose. yaml file Here, we’re gonna copy and paste the example configuration from Github, and as you can see, it already has the RDP ports forwarded to the host. I’m also going to mount the data folder from the host so that we don’t have to setup Windows from scratch every time we run the container. This will also let us share the host files with our Windows installation, by simply putting them into the shared folder. By default, the Docker container allocates 2 CPU cores and 4 gigs of RAM to the Windows VM. These are the minimum system requirements for running Windows 11.
Segment 2 (05:00 - 09:00)
We can increase those numbers by setting the RAM_SIZE and CPU_CORES variables in our compose file. And don’t worry, these are not allocated exclusively to our VM and can still be shared with the host and other VMs The default disk size for our Windows installation is 64 gigs And we can also increase that by setting a DISK_SIZE variable in our compose file. The virtual machine uses thin provisioning, which means that your VM disk file will only take as much space as it actually uses, and not the maximum capacity that we define here. Now we can save the file, quit, and download a file to place in our shared folder. After that, we’re gonna go back to the folder with our compose file, and run `docker compose up -d` Now let’s go to our WebUI, and wait till the installation is complete. As you can see, we’re back to our Windows desktop Now, I’m gonna open the Microsoft Remote Desktop application on my Mac, add a new PC, and type in the IP address of our server – in my case, 192. 168. 2. 233 Now let’s click on Add, and double click the server to connect. I’m gonna use docker as the username, and leave the password field empty. And there you have it! A full copy of Windows 11 in a Docker container! And if we want to access the files that we’ve mounted from the host We can simply go to Explorer → Network → Enable the file sharing services, click on host. lan, and there you have it! that’s our file! But what if you want to run another version of Windows? No problem – the Docker container supports pretty much every modern-ish version of Windows, from Windows 11 to Windows XP, and even the Server versions! Moreover, you can also run super lightweight versions of Windows like Tiny 10, Tiny 11 and Tiny 11 Core… and even supply your own custom images. So if, let’s say, you wanted to run Windows 11, 10, 8, 7, Vista and XP all at the same time – you could do it… But that’s pretty stupid, like who would want to do that? So anyway, here is me running Windows 11, Windows 10, Windows 7, Windows Vista and Windows XP. Windows 8. 1 didn’t work for some reason, I guess even Microsoft doesn’t want us to needlessly suffer As you can see, the N100 CPU I’m running these VMs on is… coping admirably... With all CPU cores running at full blast, and the entirety of RAM and swap being completely pegged by the VMs. At the same time, even at full bore, the system is only pulling around 18W from the wall, which is a small price to pay for losing a game of Minesweeper in four different versions of Windows… Is what I would say, if the Windows copies installed by this tool actually came with Minesweeper… The only Windows that does come with games is the good old Windows XP. If nobody got me, I know Windows XP got me. Funnily enough, Windows Vista took the longest to install, and long after all the other versions finished installing, it was still quote unquote expanding files. Which is pretty on brand for Windows Vista, I would say. One of the questions people often ask when it comes to Windows-related projects is – is this even legal? And why don’t the Windows containers ask for activation keys? Does this container install pirated copies of Windows? And no. When it comes to current versions of Windows, these come straight from the Microsoft servers and the Docker container does nothing in terms of activation – if we go to the settings, we can see that this copy of Windows is not activated. As for older versions, these come from Bob Pony, which is an open source catalog of legacy operating systems, like Windows and macOS. These versions of Windows are activated with generic keys that only work for 30 days. So if you want to use your Windows installation for more than just quickly running a Windows-only application, you’re gonna need to buy a key. On the project’s GitHub page, the author mentions that they only use open source code in the product, and don’t distribute any copyrighted material. That being said, if Microsoft really wanted to, they could probably still find a BS reason to shut this project down, so make sure to check it out soon. However, the big question is – can we use this docker container to run our BIOS editing tool? Well, I copied the executable file to our shared folder copied it to the hard drive, and… well, Bob Pony’s your uncle. So I’d say that it definitely fulfilled my use case, but let me know what you want to use it for – down in the comment section.