Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can this container boot Windows 11 (with virtio drivers installed) installed on a physical disk (e.g. /dev/mmcblk1)? #517

Open
1 task done
christyler80 opened this issue May 18, 2024 · 7 comments

Comments

@christyler80
Copy link

Is there no existing issue for this?

  • I have searched the existing issues

Machine specifications

Intel N100 16GB

Operating system

Debian Bullseye 6.1.69-1~bpo11+1 (2024-01-05)

Docker version

Docker version 26.0.0, build 2ae903e

Description

Can this container boot Windows 11 (with virtio drivers installed) installed on a physical disk (e.g. /dev/mmcblk1)?

'sudo lsblk' reports as follows and the machine is booting from /dev/mmcblk1 via partition mmcblk1p1. rEFIind boot menu default is set to boot into Windows 11.

NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
mmcblk1 179:0 0 230.5G 0 disk
├─mmcblk1p1 179:1 0 100M 0 part
├─mmcblk1p2 179:2 0 16M 0 part
├─mmcblk1p3 179:3 0 229.5G 0 part
└─mmcblk1p4 179:4 0 900M 0 part
nvme0n1 259:0 0 465.8G 0 disk
├─nvme0n1p1 259:1 0 512M 0 part /boot/efi
├─nvme0n1p2 259:2 0 89.4G 0 part /
├─nvme0n1p3 259:3 0 976M 0 part [SWAP]
└─nvme0n1p4 259:4 0 374.9G 0 part /srv/dev-disk-by-uuid-23c0e229-cc5f-40b3-bc0b-3623bb469bd7
mmcblk1boot0 179:256 0 4M 1 disk
mmcblk1boot1 179:512 0 4M 1 disk

Docker compose

version: "3"
services:
windows:
image: dockurr/windows
container_name: windows
environment:
VERSION: "win11"
DEVICE: "/dev/mmcblk1"
BOOT_MODE: "windows_plain"
MANUAL: "Y"
devices:
- /dev/mmcblk1
- /dev/kvm
cap_add:
- NET_ADMIN
ports:
- 8006:8006
- 3389:3389/tcp
- 3389:3389/udp
stop_grace_period: 2m
restart: on-failure
volumes:
- ./data:/storage

Docker log

The container appears to be stuck in a boot loop with the following message repeating in the Docker logs:-

3h3h3hBdsDxe: loading Boot0002 "UEFI QEMU QEMU HARDDISK " from PciRoot(0x0)/Pci(0xA,0x0)/Scsi(0x0,0x0)
BdsDxe: starting Boot0002 "UEFI QEMU QEMU HARDDISK " from PciRoot(0x0)/Pci(0xA,0x0)/Scsi(0x0,0x0)
3h3h3hBdsDxe: loading Boot0002 "UEFI QEMU QEMU HARDDISK " from PciRoot(0x0)/Pci(0xA,0x0)/Scsi(0x0,0x0)
BdsDxe: starting Boot0002 "UEFI QEMU QEMU HARDDISK " from PciRoot(0x0)/Pci(0xA,0x0)/Scsi(0x0,0x0)
3h3h3hBdsDxe: loading Boot0002 "UEFI QEMU QEMU HARDDISK " from PciRoot(0x0)/Pci(0xA,0x0)/Scsi(0x0,0x0)
BdsDxe: starting Boot0002 "UEFI QEMU QEMU HARDDISK " from PciRoot(0x0)/Pci(0xA,0x0)/Scsi(0x0,0x0)
3h3h3hBdsDxe: loading Boot0002 "UEFI QEMU QEMU HARDDISK " from PciRoot(0x0)/Pci(0xA,0x0)/Scsi(0x0,0x0)
BdsDxe: starting Boot0002 "UEFI QEMU QEMU HARDDISK " from PciRoot(0x0)/Pci(0xA,0x0)/Scsi(0x0,0x0)
3h3h3hBdsDxe: loading Boot0002 "UEFI QEMU QEMU HARDDISK " from PciRoot(0x0)/Pci(0xA,0x0)/Scsi(0x0,0x0)
BdsDxe: starting Boot0002 "UEFI QEMU QEMU HARDDISK " from PciRoot(0x0)/Pci(0xA,0x0)/Scsi(0x0,0x0)

Screenshots (optional)

No response

@kroese
Copy link
Contributor

kroese commented May 18, 2024

In theory that should work.. What version of Windows is installed on /dev/mmcblk1?

BTW: The windows_plain mode does not exist anymore. The only ones are windows and windows_secure (for Secure Boot) now.

@christyler80
Copy link
Author

christyler80 commented May 18, 2024 via email

@kroese
Copy link
Contributor

kroese commented May 19, 2024

If you start a working container (with a data.img) and you add this line to that compose file:

devices:
  - /dev/mmcblk1:/disk2

After you start Windows and go to Disk Management from the Adminstrative Tools, do you see the second drive? Can you assign a drive letter to the partitions and browse them?

@christyler80
Copy link
Author

christyler80 commented May 19, 2024 via email

@christyler80
Copy link
Author

christyler80 commented May 22, 2024 via email

@kroese
Copy link
Contributor

kroese commented May 22, 2024

Okay, if it can be read then I have not really a clue why QEMU doesnt want to boot it.

There might be a workaround. If you download a tool like EasyBCD (or bcdedit that comes with Windows), you should be able to add that secondary drive as a multi-boot entry.

In that case it will not be the QEMU bios that boots the drive directly, but a dummy Windows install on the first drive that boots the secondary (physical) drive entry via its own bootloader.

I think there is a good chance it will work that way. And if you make the secondary drive the default entry, the end-result will be undistinguishable from directly booting it.

@christyler80
Copy link
Author

christyler80 commented May 22, 2024 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants