how to boot sabrelite linux image on qemu - linux-kernel

What is the right command to boot sabrelite linux kernel on qemu.
I've linux kernel zImage and rootfs of type ext3
I'm trying to boot kernel with following command line but there is no any console output.
./qemu-system-arm -M sabrelite -m 1G -kernel zImage -smp 4 -drive file=console-image-mx6q-rootfs.ext3,format=raw,id=mycard -device sd-card,drive=mycard -append "console=ttymxc1,115200 root=/dev/mmcblk0p0 rootfstype=ext3 rw" -dtb zImage-imx6q-sabresd.dtb
QEMU : 3.0.0 version.

I had issues getting the rootfs to mount correctly on IMX6 emulated with Qemu; this Q&A on SO solved the issue:
Qemu Freescale i.MX6 DualLite SABRE : root filesystem does not mount
It did involve patching the Qemu codebase, but that was a year back; so now, using the latest ver, hopefully it works..
FYI, this is the command I used to launch it:
qemu-system-arm -m 2048 -M sabrelite -kernel <path-to-zImage> -drive file=<path-to-my-rfs.img>,format=raw,id=mysdcard -device sd-card,drive=mysdcard -append "console=ttymxc0 rootfstype=ext4 root=/dev/mmcblk0 rw rootwait init=/sbin/init" -no-reboot -nographic -dtb <path-to>/imx6dl-sabresd.dtb
HTH..

Related

Having trouble mounting .ISO file when using QEMU

I'm running a MacBook Air M1 with Big Sur 11.4 installed
I'm trying to mount an ISO image of the Virtio-Win networking driver, using the following commands in my start.sh file.
-drive file=/Users/username/Downloads/windows-10/virtio-win-0.1.190.iso,media=cdrom,if=none,id=drivers \
-device usb-storage,drive=drivers
The drive does not show up when I run the QEMU Windows 10 ARM instance, everything else works just fine.
Are there other options for moving files or images from my host to the QEMU instance?
In my case, I need to use -cdrom and -boot d
This works for me:
-bios ./bios.fd \
-drive if=virtio,format=raw,file=./debian.qcow2,discard=on \
-cdrom ./ubuntu-21.04-live-server-arm64.iso \
-boot d

Failed to install ubuntu on QEMU for macOS host

I am new to QEMU virtual machine.
I am now installing ubuntu16.04 on QEMU virtual machine for macOS catalina host by following this tutorial:
https://graspingtech.com/ubuntu-desktop-18.04-virtual-machine-macos-qemu/
However, after I command to launch QEMU with ubuntu ISO, I didn't get into the ubuntu installer.
I command:
qemu-system-x86_64 \
-m 2048 \
-vga virtio \
-show-cursor \
-usb \
-device usb-tablet \
-enable-kvm \
-cdrom /Users/my_path/QEMU/ubuntu-16.04.6-desktop-amd64.iso \
-drive file=/Users/mt_path/QEMU/ubuntu-16.04.6-live-server-amd64.qcow2,if=virtio \
-accel hvf \
-cpu host
, but I got No bootable device on QEMU
No bootalbe device
Does anyone know how to fix it?
You should also specify a boot drive when launching the vm
Running qemu-system-x86_64 --help on my machine yields this regarding the boot order:
-boot [order=drives][,once=drives][,menu=on|off]
[,splash=sp_name][,splash-time=sp_time][,reboot-timeout=rb_time][,strict=on|off]
'drives': floppy (a), hard disk (c), CD-ROM (d), network (n)
'sp_name': the file's name that would be passed to bios as logo picture, if menu=on
'sp_time': the period that splash picture last if menu=on, unit is ms
'rb_timeout': the timeout before guest reboot when boot failed, unit is ms
In your case that should be -boot c for hard disk (c).
The problem is solved.
That is because I made some dummy to the .qcow2 file.
I tried to re-make the .qcow2 and re-download the .iso, and it works.

How to install archlinux EFI grub with MBR (msdos) partation table?

As we know, EFI boot is not limited to GPT partition table, and MBR is ok.
I've a legacy disk with msdos partition table, and I'd like to reinstall it into archlinux.
In wiki:
https://wiki.archlinux.org/index.php/GRUB#UEFI_systems
it also said that GPT is not necessary.
GPT is not strictly necessary, but it is highly recommended and is the only method currently supported in this article.
What is the way to install grub EFI boot to my hard drive with MBR partition table? Thx.
Assuming:
/dev/sda1 is your efi partition
/dev/sda2 is your root partition (containing /boot too)
Your linux kernel file is /boot/vmlinuz-linux
Your initrd file is /boot/initrd.img
Burn a live usb of ubuntu 16.04 with amd64 architecture, boot on it and paste these commands:
sudo os-prober
efibootmgr
Install os-prober or efibootmgr if it isn't installed yet:
sudo apt-get install os-prober
sudo apt-get install efibootmgr
Grub in efi mode is probably not installed, install it too
sudo apt-get install grub-efi-amd64-signed
Then, install grub:
sudo mount -t ext4 /dev/sda2 /mnt
sudo mount -t vfat /dev/sda1 /mnt/boot/efi
grub-install --target=x86_64-efi --efi-directory=/mnt/boot/efi --boot-directory=/mnt/boot --bootloader-id=grub
Don't try to use grub-mkconfig, it will not work.
Instead, boot from your newly grub bootloader, you will have a grub shell, paste these commands:
set root=(hd0,2)
linux /boot/vmlinuz-linux root=/dev/sda2
initrd /boot/initrd.img
boot
After that, you should be on linux, mount your efi partition (to /boot/efi !) if it's not already, install grub/os-prober/efibootmgr, and run these:
sudo os-prober
grub-install --target=x86_64-efi --efi-directory=/boot/efi --boot-directory=/boot --bootloader-id=grub
grub-mkconfig -o /boot/grub/grub.cfg
Reboot, and grub is back and working

windows7 stop at "starting windows" while intalling on kvm

After updating my KVM to a newer version,I cannot install windows7 anymore.
Following is the command to install:
virt-install --name win7 --memory 8192 --vcpu sockets=1,cores=8,threads=1 \
--cdrom=/usr/local/kvm/iso/win7.iso \
--disk path=/usr/local/kvm/images/win7.img,size=100,bus=sata \
--network bridge=br0,model=virtio \
--os-type windows --os-variant win7 \
--noautoconsole --accelerate --hvm \
--graphics vnc,password=123456,listen=0.0.0.0,port=20001 \
--cpu host-passthrough --arch x86_64
I'm sure it worked earlier with the same command until I updated my server two days ago.
It is stuck here:
Click here to see pictures
some version Information:
centos7 3.10.0-327.18.2.el7.x86_64
libvirt 1.2.17
I tried to install windows10 and it's working properly.
Does anyone know about this issue?
solved!
Look here:Windows 7 Setup hangs at “Starting Windows” using Proxmox 4.2
and add this to command line:
--video cirrus
Machine Detail -> Video -> selected cirrus

Embedded Linux emulation with QEMU (on LPC313X by NXP)

I'm starting to work with Embedded Linux and I've got a LPC313x based board (Embedded Artists). I've built apex and kernel with ELDK (as suggested here: http://www.lpclinux.com/LPC313x/LPC313xGettingstartedELDK).
The kernel is built correctly (apparently no error occurs) with the default settings, and I am using a pre-made ramdisk, provided at the same link.
Now I want to use QEMU to emulate my system prior to load all the stuff in the physical board. To do that, I'm using the command:
qemu-system-arm -kernel kernel/work_2.6.28.2/arch/arm/boot/zImage -initrd ../eldk42/arm/images/ramdisk_image.gz
I cannot get it work! QEMU starts but the emulator screen remains black, nothing happens. What am I missing here?
You board is not supported by Qemu. You have to write your own Board Support Package, if you can't find one on the Internet. Try checking the kernel source tree, you might find one there.
Plus you have to know the exact internal details of your SoC and board.
Try this:
qemu-system-arm -kernel
kernel/work_2.6.28.2/arch/arm/boot/zImage
-initrd ../eldk42/arm/images/ramdisk_image.gz
-append "root=/dev/ram"
Try with -m:
qemu-system-arm -m 128 -kernel
kernel/work_2.6.28.2/arch/arm/boot/zImage
-initrd ../eldk42/arm/images/ramdisk_image.gz
-append "root=/dev/ram"
Try with -M:
qemu-system-arm -M versatilepb -m 128 -kernel
kernel/work_2.6.28.2/arch/arm/boot/zImage
-initrd ../eldk42/arm/images/ramdisk_image.gz
-append "root=/dev/ram"
You are basically making /dev/ram (which you provide with -initrd argument) as your system's root directory. You can find more information here.
You're probably interested in the linux option console=ttyS0 which you can add to -append of qemu.

Resources