VM: lxc: Running Windows 8.1 inside lxc (Success)

In this lxc walkthrough we are able to get Windows 8.1 working inside an lxc container.

VM: lxc: Running Windows 8.1 inside lxc (Success)
Photo by Tadas Sar / Unsplash

In the last two attempts none of the guides have worked.  Firstly running Windows 10 inside an lxc container via the Ubuntu guide failed. Next attempting to run rufus inside wine (which has older images of windows - also failed.)  Windows simply does not play nice with linux whatsoever and basically works hard to make sure you either have windows on your machine enabled with a manufacturers secure boot registered machine - or you are on your own.  

In this next attempt we have found that you can download Windows 8.1 .iso image from here - which we will try a standard Ubuntu guide for again.  To double-troubleshoot we will try both the 32-bit and 64-bit install CD-ROM' iso.  We will try both distro-builder images and just standard .iso images.

  • Check here for the basics of installing lxc, then create your two containers:
  • Resize the drives to 50GB or something minimal:
  • We will add vtpm (Trusted Platform Module) to both:
  • We will just try standard .iso's and see if they work to start:
lxc init win8-32 --vm --empty
lxc init win8-64 --vm --empty
lxc config device override win8-32 root size=50GB
lxc config device override win8-64 root size=50GB
lxc config device add win8-32 vtpm tpm path=/dev/tmp0
lxc config device add win8-64 vtpm tpm path=/dev/tmp0
lxc config device add win8-32 cdrom disk source=/q2/qemu/win/Win8.1_English_x32.iso boot.priority=10
lxc config device add win8-64 cdrom disk source=/q2/qemu/win/Win8.1_English_x64.iso boot.priority=10

We can inspect our containers now:

Finally success!  win8-64 took no distrobuilder required - it just worked - or does it??

  • Just as it boots it will ask 'Press any Key to Boot from CDROM'

Although it did boot it still failed - it is looking for drivers.  

Attempting to pack drivers in but! distrobuilder only supports the latest versions:

sudo distrobuilder repack-windows --windows-version 8.1 Win8.1_English_x64.iso win64.iso

Error: Version must be one of [w11 w10 2k19 2k12 2k16 2k22]

So try windows 10 - it might work.

sudo distrobuilder repack-windows --windows-version w10 Win8.1_English_x64.iso win64.iso

Now we will build it back into the lxc image:

lxc config device add win8-64 cdrom disk source=/q2/qemu/win/win64.iso boot.priority=10

After this point you would require a legitimate windows 8 but it would theoretically work:

For our instance we only need windows temporarily to run a single application for training and therefore we will continue to see if there is a way to do this. There are VM images but they again do not seem to be designed to run inside windows.

Linux Rocks Every Day