I’m hoping you can help me out with an issue I’ve come across while playing around with QEMU.
Basically, I made a QEMU on Windows using the following 3 batch scripts.
1) createvm
@echo off set "QEMUDIR=%USERPROFILE%\Documents\qemu" if not exist hda.img ( %QEMUDIR%\qemu-img.exe create hda.img 40G ) else ( echo file hda.img already exist. Delete or move and try again. goto:eof )
2) installvm
@echo off set "QEMUDIR=%USERPROFILE%\Documents\qemu" set "ISOFILE=%USERPROFILE%\Downloads\ubuntu-16.04.3-server-amd64.iso" set "QEMUBIN=qemu-system-x86_64.exe" start "QEMU" %QEMUDIR%\%QEMUBIN% -drive file=hda.img,index=0,media=disk,format=raw -cdrom %ISOFILE% ^ -m 2G -L Bios -usbdevice mouse -usbdevice keyboard -boot menu=on ^ -rtc base=localtime,clock=host ^ -parallel none -serial none -name centos -no-acpi -no-hpet -no-reboot ^
3) runvm
@echo off set "QEMUDIR=%USERPROFILE%\Documents\qemu" set "QEMUBIN=qemu-system-x86_64.exe" start "QEMU" %QEMUDIR%\%QEMUBIN% -smp 8,sockets=4,cores=2,threads=1 ^ -numa node,nodeid=0,cpus=0-3 ^ -numa node,nodeid=1,cpus=4-7 ^ -drive file=hda.img,index=0,media=disk,format=raw -m 2G -L Bios -boot menu=on ^ -rtc base=localtime,clock=host -parallel none -serial none -name centos ^ -no-acpi -no-hpet -no-reboot -device usb-mouse -device usb-kbd -usb -device e1000,netdev=user.0 ^ -netdev user,id=user.0,hostfwd=tcp::2222-:22
After all this, I decided I needed to run it from Linux (with a couple of extra arguments). So I copied over my hda file to Linux and ran the VM with following command (spaced by ‘^’ for clarity).
sudo qemu-system-x86_64 -m 4096 --enable-kvm -hda hda_2.img ^ -monitor stdio -nographic -serial mon:stdio ^ -kernel ./bzImage ^ -append "BOOT_IMAGE=/vmlinuz-4.4.0-87-generic root=/dev/sda1 ro console=ttyS0"
The problem is that I’m not sure what to set as my root, and as a result I’m getting these Kernel errors when the above command is run:
[ 0.693575] EXT4-fs (sda1): couldn't mount as ext3 due to feature incompatibilities [ 0.696136] EXT4-fs (sda1): mounting ext2 file system using the ext4 subsystem [ 0.702483] EXT4-fs (sda1): mounted filesystem without journal. Opts: (null) [ 0.704906] VFS: Mounted root (ext2 filesystem) readonly on device 8:1. [ 0.707408] devtmpfs: error mounting -2 [ 0.710369] Freeing unused kernel memory: 1336K (ffffffff81d1f000 - ffffffff81e6d000) [ 0.712669] Write protecting the kernel read-only data: 12288k [ 0.715066] Freeing unused kernel memory: 820K (ffff880001733000 - ffff880001800000) [ 0.722002] Freeing unused kernel memory: 720K (ffff880001b4c000 - ffff880001c00000) [ 0.724375] Kernel panic - not syncing: No working init found. Try passing init= option to kernel. See Linux Documentation/init.txt for guidance.
Some things I tried was running the VM in windows I accessed the ‘/etc/default/grub/’ file, setting ‘GRUB_CMDLINE_LINUX_DEFAULT’ to ‘console=ttyS0’, re-copying my hda file to Linux, and running this again — but it didn’t help.
Does anyone have some insight as to what my issue might be? Or what I need to set my root to?
Thanks in advance. 🙂
What I’ve tried: I altered my -append text to say:
"BOOT_IMAGE=/vmlinuz-4.4.0-87-generic root=/dev/sda1 ro console=ttyS0 rootfstype=ext4"
My error messages now only says the following:
[ 0.697675] EXT4-fs (sda1): mounted filesystem without journal. Opts: (null) [ 0.699763] VFS: Mounted root (ext4 filesystem) readonly on device 8:1.