View previous topic :: View next topic |
Author |
Message |
szatox Advocate

Joined: 27 Aug 2013 Posts: 3536
|
Posted: Sat Mar 01, 2025 9:23 pm Post subject: Qemu: with guest root on 9p / kernel params? |
|
|
I want to put VM guest root on 9p because reasons.
Using direct boot, optionally dracut initramfs (shouldn't be required though), and virtio-9p to pass an FS from host to guest.
What params should I put on kernel boot line to get it to work?
9p is compiled in the kernel, and I can mount the fs inside dracut, with:
mount /9proot -t 9p /sysroot
but when I boot it with those options on kernel command line:
root=/9proot rootfstype=9p
dmesg reports "dracut: don't know how to handle root=/9proot" (or just kernel panic due to missing root if I go without initramfs).
Either way, looks like I've got all the pieces, but somehow they just don't click together. Any ideas? _________________ Make Computing Fun Again |
|
Back to top |
|
 |
pietinger Moderator

Joined: 17 Oct 2006 Posts: 5460 Location: Bavaria
|
|
Back to top |
|
 |
szatox Advocate

Joined: 27 Aug 2013 Posts: 3536
|
Posted: Sat Mar 01, 2025 11:22 pm Post subject: |
|
|
Well, it is true I could just modify that initramfs, but I don't really think dracut is at fault here. I actually only put it there to help me figure out how to use 9p, and now that I've figured it out, I'd be perfectly happy to ditch it.
Root and rootfstype are kernel parameters, I pulled them from kernel's docs. I though they'd be enough for kernel to mount the actual root without going through initramfs in the first place, but no dice.
Edit: Ok, so the first problem was that root must be /dev/root.
Funny, I think I used to put /dev/hda2 back in the days.... I wonder if it's 9p thing or has this been abandoned. Anyway; gotta figure out why it can't run init now that it finally finds it... _________________ Make Computing Fun Again |
|
Back to top |
|
 |
szatox Advocate

Joined: 27 Aug 2013 Posts: 3536
|
Posted: Sun Mar 02, 2025 3:46 pm Post subject: |
|
|
Alright, I think I've got it, after converting permissions to xattrs it looks like it's going to work (qemu running as an unprivileged user, so has to use some fakeroot tricks).
So, if anyone wanted to put guest's root on 9p, this particular device must be named /dev/root and then initramfs is not required. Other mountpoints don't have this restriction. _________________ Make Computing Fun Again |
|
Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|