Windows 10: no bootable device

Still confused.

I have a situation:

  1. a qube named Windows10
  2. without any patches or any modifications to stubdom or xen.xml
  3. without GPU pass-through,
  4. USB Controller being attached via qvm-pci in turned off qube state,
  5. memory is set ot 8GiB.

This qube does not start with “No bootable device”.

I want: to start this Window10 qube.
What should be done in this simplest scenario to make it work? Is it possible?

If I detach persistent USB Controller or if I set memory under 800 MiB - qube starts. But otherwise it does not.

1 Like

“maxmem” ? You disabled memory balancing, correct ?


I don’t have issue doing what you are trying to do, and if you haven’t done any modification to either xen.xml or stubdom then I have no idea what the problem could be.

Maybe this specific usb controller have requirement similar to a GPU, but that case should not exist

1 Like

Yes I did. Sorry, I meant memory, not maxmem.

  1. If you try the same thing in a linux HVM, does it work ?
  2. If it doesn’t work in the linux HVM, set the ram to ~500MiB and share the output of the command lspci -vvvnns YOUR_USB_CONTROLLER_IDENTIFIER from your linux hvm

No, it does not. It’s Qubes OS or Xen problem, not Windows-related.

I have it running with 1000 MiB (but I can change to 500 MiB if there is a difference):

lspci -vvvnns
__:__._ USB controller [0c03]: NEC Corporation uPD720200 USB 3.0 Host Controller [1033:0194] (rev 04) (prog-if 30 [XHCI])
        Subsystem: Samsung Electronics Co Ltd Device [144d:c0a5]
        Physical Slot: 6
        Control: I/O- Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B- DisINTx+
        Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=fast >TAbort- <TAbort- <MAbort- >SERR- <PERR- INTx-
        Latency: 0, Cache Line Size: 64 bytes
        Interrupt: pin A routed to IRQ 87
        Region 0: Memory at f2012000 (64-bit, non-prefetchable) [size=8K]
        Capabilities: <access denied>
        Kernel driver in use: xhci_hcd
        Kernel modules: xhci_pci

Ok, I have a ugly bruteforce proposal.
Trying a lot of different values for max-ram-below-4g.

  • Clone your linux hvm (with your usb pci passthrough and 8G of ram) to a vm named “totest”

In dom0, copy the script “putain1.sh” and run it
(The goal of this script is to create a stubdom rootfs with configurable value for max-ram-below-4g)
putain1.sh :

#!/bin/bash 

patch_rootfs(){

 filename=${1?Filename is required}

 cd ~/

 sudo rm -R "patched_$filename"
 mkdir "patched_$filename"

 cp /usr/libexec/xen/boot/$filename "patched_$filename/$filename.gz"
 cp /usr/libexec/xen/boot/$filename "$filename.original"

 cd patched_$filename
 gunzip $filename.gz
 cpio -i -d -H newc --no-absolute-filenames < "$filename"
 sudo rm $filename

 grep -i "max-ram-below-4g" init && echo "!!ERROR!! The thing is already patched ! EXITING ! " >&2 && exit

patch_string=$(cat <<'EOF'


vm_name=$(xenstore-read "/local/domain/$domid/name")
if [ $(echo "$vm_name" | grep -iEc '^gpu_' ) -eq 1 ]; then
 max_ram_below_4g=$(echo "$vm_name" | grep -iEo "_([0-9]*(n[0-9]*)?)._" | cut -d '_' -f 2)
 if [[ -z "$max_ram_below_4g" ]];
 then
  max_ram_below_4g="2G"
 fi
 max_ram_below_4g=$(echo "$max_ram_below_4g" | sed 's/n/./g')
 dm_args=$(echo "$dm_args" | sed -n '1h;2,$H;${g;s/\\(-machine\\nxenfv\\)/\\1,max-ram-below-4g='"$max_ram_below_4g"'/g;p}')
fi
\# $dm_args and $kernel

EOF
)

awk -v r="$patch_string" '{gsub(/^# \$dm_args and \$kernel/,r)}1' init > init2
mv init2 init
chmod +x init

 find . -print0 | cpio --null -ov \
--format=newc | gzip -9 > ../$filename.patched
 sudo cp ../$filename.patched /usr/libexec/xen/boot/$filename

 cd ~/


}

grep -i "max-ram-below-4g" /usr/share/qubes/templates/libvirt/xen.xml && "!!ERROR!! xen.xml is patched ! EXITING ! " && exit
patch_rootfs "qemu-stubdom-linux-rootfs"
patch_rootfs "qemu-stubdom-linux-full-rootfs"

echo "stubdom have been patched."

Then in dom0 copy the file “putain2.sh” and run it.
The goal of this script is to try a lot of different value for max-ram-below-4g.
putain2 :

#!/bin/bash 
VM_TO_TEST="totest"

data=$(qvm-prefs "$VM_TO_TEST")
echo "$data" | grep -E "^name" || echo "The VM $VM_TO_TEST doesn't exist. it will crash"
echo "$data" | grep -E "^virt_mode"
echo "$data" | grep -E "^maxmem"
echo "$data" | grep -E "^memory"

for i in "4G" "3.9G" "3.6G" "3.5G" "3.4G" "3.1G" "3G" "2.9G" "2.6G" "2.5G" "2.4G" "2.1G" "2G" "1.9G" "1.6G" "1.5G" "1.4G" "1.1G" "1G" "0.9G" "0.6G" "0.5G" "0.4G"
do
 echo "testing $i"
 newvm="gpu_""$i""_putain"
 newvm=$(echo "$newvm" | sed "s/\./n/g")
 echo "trying to create $newvm"
 qvm-clone "$VM_TO_TEST" "$newvm"

# Depending on how slow your computer is you could need to increase the value '30' to something bigger
 sleep 30 && qvm-shutdown --force "$newvm" 2> /dev/null > /dev/null &

 qvm-run --pass-io "$newvm" "uname -a" && echo "SUCCESS! REPORT THIS: $newvm"
 qvm-shutdown --force "$newvm"

# Depending on how slow your computer is you could need to increase the value '10' to something bigger
 sleep 10

 qvm-remove -f "$newvm"
done

I am interested in the output of thoses scripts.
“SUCCESS! REPORT THIS” being the one that interest you the most.
If you find no “SUCCESS! REPORT THIS” in the output of “putain2.sh” you can try to add additional value in the putain2.sh script (like testing every 100mb of ram “4G” “3.9G” “3.8G” “3.7G” … “0.2G” “0.1G” )

2 Likes

I have the exact same problem. Windows 10 guest, only a single Thunderbolt USB dock attached via the Qube Manager. It works when memory is set to 800MB, but not if I use anything larger.
@balko did you make progress on this?

No progress. @neowutran in the previous post gave me some info about what else can be tried with this max-ram-below-4g magic, but I has not tried it yet and currently I work without PCI attachment in Win10 (and have a lot of memory set).

So, maybe you can try it, especially considering the fact your limit of 800 MiB is almost the same as I had.

To remind, I cannot start Win HVM with more than 2GB RAM. No passthrough, no external drives/controllers.

I can start Win HVM with passtrough with as much as possible GB RAM, with persistent external drive attached.

2GB xen.xml patch applied all the time.

It is a different issue (and reason), isn’t it? I mean your case is even worse and should be addressed faster by devs. Can you remind the issue on github?

Unfortunately, I don’t have github account.

Did you try with no USB and with >3.5GB RAM?

Did you try

qvm-pci attach --persistent --option permissive=true --option no-strict-reset=true …

or

qvm-usb attach --persistent --option permissive=true --option no-strict-reset=true

Yes, if nothing is connected I can get 8 GiB of RAM in Win10 without issues.

Boot with a lot of memory works for me with USB attaching (qvm-usb), but not PCI (qvm-pci).

So, you succeeded. That’s great.

Well, I had the problem with only PCI right from the start. Yes, it is about USB Controller, but it is a PCI device, not USB device itself. So, nothing actually changed for me. If I attach PCI USB Controller to the Win10 qube it won’t start with any reasonable amount of memory.