You are not logged in.

#1 2021-06-17 10:01:59

nzdave
Member
From: Wellington, New Zealand
Registered: 2014-05-06
Posts: 7

[SOLVED]GRUB rescue on fresh QEMU Arch install

Im trying to install a very basic Arch Linux VM using Virtual machine manager.
Single disk with two partitions 1 for swap and 1 for root (ext4) as per the partitioning guide.
After running `grub-install --target=i386-pc /dev/vda` and `grub-mkconfig -o /boot/grub/grub.cfg` and rebooting the box i am taken straight to the grub prompt.
From there I am able to run
```
set root=(hd0,msdos2)
linux /boot/vmlinuz-linux root=/dev/vda2
initrd /boot/initramfs-linux.img
boot
```
And the thing boots into linux quite happily.
However after each reboot, I land back at the grub prompt
Ive tried
- running the grub install again from within the "real" linux environment
- running the grub mkconfig again from within the "real" linux environment
- Attaching the same disk with different modes (virtio/sata)
- With sparse files as disks and pre-allocated disks

So it feels like the grub install is working, but grub is then unable to locate the grub.cfg on the disk.
Ive had a look at the grub.cfg and it looks good from what I can make out- happy to post this up if it helps with debugging.

Ive run through the same process in virtualbox and had had no such issues, so im a bit stumped.

Here is the process output for the running virtual machine:
nobody    291418       1 84 21:48 ?        00:00:13 /usr/bin/qemu-system-x86_64 -name guest=archlinux,debug-threads=on -S -object secret,id=masterKey0,format=raw,file=/var/lib/libvirt/qemu/domain-6-archlinux/master-key.aes -machine pc-q35-5.2,accel=kvm,usb=off,vmport=off,dump-guest-core=off,memory-backend=pc.ram -cpu Broadwell-noTSX-IBRS,vme=on,ss=on,vmx=on,pdcm=on,f16c=on,rdrand=on,hypervisor=on,arat=on,tsc-adjust=on,umip=on,md-clear=on,stibp=on,arch-capabilities=on,ssbd=on,xsaveopt=on,pdpe1gb=on,abm=on,ibpb=on,amd-stibp=on,amd-ssbd=on,skip-l1dfl-vmentry=on,pschange-mc-no=on -m 1024 -object memory-backend-ram,id=pc.ram,size=1073741824 -overcommit mem-lock=off -smp 1,sockets=1,cores=1,threads=1 -uuid 1d4bfff6-83f0-4344-8d69-465355c6aee7 -no-user-config -nodefaults -chardev socket,id=charmonitor,fd=32,server=on,wait=off -mon chardev=charmonitor,id=monitor,mode=control -rtc base=utc,driftfix=slew -global kvm-pit.lost_tick_policy=delay -no-hpet -no-shutdown -global ICH9-LPC.disable_s3=1 -global ICH9-LPC.disable_s4=1 -boot strict=on -device pcie-root-port,port=0x10,chassis=1,id=pci.1,bus=pcie.0,multifunction=on,addr=0x2 -device pcie-root-port,port=0x11,chassis=2,id=pci.2,bus=pcie.0,addr=0x2.0x1 -device pcie-root-port,port=0x12,chassis=3,id=pci.3,bus=pcie.0,addr=0x2.0x2 -device pcie-root-port,port=0x13,chassis=4,id=pci.4,bus=pcie.0,addr=0x2.0x3 -device pcie-root-port,port=0x14,chassis=5,id=pci.5,bus=pcie.0,addr=0x2.0x4 -device pcie-root-port,port=0x15,chassis=6,id=pci.6,bus=pcie.0,addr=0x2.0x5 -device pcie-root-port,port=0x16,chassis=7,id=pci.7,bus=pcie.0,addr=0x2.0x6 -device qemu-xhci,p2=15,p3=15,id=usb,bus=pci.2,addr=0x0 -device virtio-serial-pci,id=virtio-serial0,bus=pci.3,addr=0x0 -blockdev {"driver":"file","filename":"/var/lib/libvirt/images/archlinux1.qcow2","node-name":"libvirt-2-storage","auto-read-only":true,"discard":"unmap"} -blockdev {"node-name":"libvirt-2-format","read-only":false,"driver":"qcow2","file":"libvirt-2-storage","backing":null} -device virtio-blk-pci,bus=pci.4,addr=0x0,drive=libvirt-2-format,id=virtio-disk0,bootindex=2 -blockdev {"driver":"file","filename":"/storage/iso/archlinux-2020.10.01-x86_64.iso","node-name":"libvirt-1-storage","auto-read-only":true,"discard":"unmap"} -blockdev {"node-name":"libvirt-1-format","read-only":true,"driver":"raw","file":"libvirt-1-storage"} -device ide-cd,bus=ide.0,drive=libvirt-1-format,id=sata0-0-0,bootindex=1 -netdev tap,fd=34,id=hostnet0,vhost=on,vhostfd=35 -device virtio-net-pci,netdev=hostnet0,id=net0,mac=52:54:00:9c:ee:b7,bus=pci.1,addr=0x0 -chardev pty,id=charserial0 -device isa-serial,chardev=charserial0,id=serial0 -chardev socket,id=charchannel0,fd=36,server=on,wait=off -device virtserialport,bus=virtio-serial0.0,nr=1,chardev=charchannel0,id=channel0,name=org.qemu.guest_agent.0 -chardev spicevmc,id=charchannel1,name=vdagent -device virtserialport,bus=virtio-serial0.0,nr=2,chardev=charchannel1,id=channel1,name=com.redhat.spice.0 -device usb-tablet,id=input0,bus=usb.0,port=1 -spice port=5900,addr=127.0.0.1,disable-ticketing=on,image-compression=off,seamless-migration=on -device qxl-vga,id=video0,ram_size=67108864,vram_size=67108864,vram64_size_mb=0,vgamem_mb=16,max_outputs=1,bus=pcie.0,addr=0x1 -device ich9-intel-hda,id=sound0,bus=pcie.0,addr=0x1b -device hda-duplex,id=sound0-codec0,bus=sound0.0,cad=0 -chardev spicevmc,id=charredir0,name=usbredir -device usb-redir,chardev=charredir0,id=redir0,bus=usb.0,port=2 -chardev spicevmc,id=charredir1,name=usbredir -device usb-redir,chardev=charredir1,id=redir1,bus=usb.0,port=3 -device virtio-balloon-pci,id=balloon0,bus=pci.5,addr=0x0 -object rng-random,id=objrng0,filename=/dev/urandom -device virtio-rng-pci,rng=objrng0,id=rng0,bus=pci.6,addr=0x0 -sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny -msg timestamp=on

Last edited by nzdave (2021-06-20 08:48:22)

Offline

#2 2021-06-17 11:00:22

Maniaxx
Member
Registered: 2014-05-14
Posts: 738

Re: [SOLVED]GRUB rescue on fresh QEMU Arch install

What's wrong with default 'target=x86_64-efi'?


sys2064

Offline

#3 2021-06-19 09:16:06

nzdave
Member
From: Wellington, New Zealand
Registered: 2014-05-06
Posts: 7

Re: [SOLVED]GRUB rescue on fresh QEMU Arch install

When you say default, are you meaning the grub default?
I cannot find any reference to that being the default here: https://wiki.archlinux.org/title/GRUB, I'm following the MBR specific instructions.

For libvirt, the default firmware is BIOS. To enable UEFI requires additional config - https://wiki.archlinux.org/title/Libvirt#UEFI_Support

I understand I could go down the EFI path (I am using that on my laptop), however I'm not convinced that it would provide any benefit on a VM.

Any help on getting the GRUB BIOS issue would be appreciated.

Thanks

Offline

#4 2021-06-19 14:32:42

Maniaxx
Member
Registered: 2014-05-14
Posts: 738

Re: [SOLVED]GRUB rescue on fresh QEMU Arch install

nzdave wrote:

When you say default, are you meaning the grub default?

I mean the entry that gets picked when you omit the parameter. But maybe I'm wrong here. You can use the old legacy stuff indeed but right now you are facing the problems why these things were abandoned. This might be a mapping issue.

Nevertheless, it should work somehow.
Is there any error message in recovery console? In what state is Grub exactly (see here).
Please post your 'fdisk -l' output.

Last edited by Maniaxx (2021-06-19 14:34:57)


sys2064

Offline

#5 2021-06-20 08:44:01

nzdave
Member
From: Wellington, New Zealand
Registered: 2014-05-06
Posts: 7

Re: [SOLVED]GRUB rescue on fresh QEMU Arch install

Ah right, I didnt realise you could run it without specifying a target.
Thats good to know thanks.
I ran it without the the target and it picked i386-pc

That GRUB2 troubleshooting article is exactly what I had been hunting for thanks!
It has allowed me to find the problem which is incredibly embarrassing.

With the grub-mkconfig command I was outputting to grub.conf instead of grub.cfg *facepalm*

Thanks for the links and pointing me in the right direction

Offline

Board footer

Powered by FluxBB