Issues with making EasyOS run (in a virtual machine)

Yes, the message means it cant find initrd
So grub-imagemounter has tried to make a custom 60_custom file, and failed

Can you not do it the same way as you did to specify the usb drive?

I seems not  .

In virt-manager´s settings I accomplished it with “add host usb device”. Here the stick was listed of course.
But not any host´s loop device.
Basically what needs to be done is make the loop device appear as a usb device. But I´ve no idea whether that could be done … 

I see. I thought you were just typing in the device name, but you are using a menu in virt-manager
Maybe you could go back to using qemu at the command line?

I finally understand that loop mount now,
/dev/loop0 is whole disk ( like sda)
that unnamed partition is the mbr
/mnt/rosika/easy2 is the partition with EasyOS on it (like sda1)

So you need to specify /dev/loop0 to qemu, not the /mnt…

Gee I am slow sometimes.

I need to learn qemu for my own use, so I will some experiments

Regards
Neville

1 Like

@Rosika
This may help

1 Like

Hi Daniel, :wave:

thanks.

Actually no. I guess had you clicked on the link I provided you could´ve seen all 6 tests were made using IMG.

Many greetings from Rosika :slightly_smiling_face:

Hi Neville,:wave:

Hmm :thinking: … I guess `grub-imagemounter did make the 60_custom file but there was still something wrong.
In my post #52 you could see:

### BEGIN /etc/grub.d/60_grub-imageboot ###
menuentry "Bootable ISO Image: rescatux" {
	insmod part_msdos
	insmod ext2
	search --no-floppy --fs-uuid --set=root 67f90c65-a50f-472d-bda7-1abeb5d01e52
	linux16 /boot/memdisk iso
	initrd16 /boot/images/rescatux.iso
}
menuentry "Bootable ISO Image: trisquel-mini_9.0_amd64" {
	insmod part_msdos
	insmod ext2
	search --no-floppy --fs-uuid --set=root 67f90c65-a50f-472d-bda7-1abeb5d01e52
	linux16 /boot/memdisk iso
	initrd16 /boot/images/trisquel-mini_9.0_amd64.iso
}
### END /etc/grub.d/60_grub-imageboot ###

But the entries there certainly differ from what you would put in 40_custom…

Never mind. At least I was successful in creating the following entry in 40_custom and this one worked:

cat 40_custom 
#!/bin/sh
exec tail -n +3 $0
# This file provides an easy way to add custom menu entries.  Simply type the
# menu entries you want to add after this comment.  Be careful not to change
# the 'exec tail' line above.

menuentry 'linuxmint-20.2-xfce-64bit ISO' {
    set isofile="/boot/images/linuxmint-20.2-xfce-64bit.iso"
    loopback loop (hd0,1)$isofile
                bootoptions="vconsole.keymap=de-latin1-nodeadkeys locale.LANG=de_AT.UTF-8"
    linux (loop)/casper/vmlinuz boot=casper iso-scan/filename=$isofile quiet splash
    initrd (loop)/casper/initrd.lz
    }

Now LinuxMint boots from iso.
Alas the keyboard layout is still in English. I guess I didn´t provide the correct parameters after all… :expressionless:

The grub menu however has still the entry generated by grub-imageboot.
I´m not entirely sure how to get rid of that…

Yes … from the settings menu I could add (or rather: redirect) usb devices from host. Thus it was simple to add the physical USB drive to the vm. :wink:
But for a host´s loop device this can not be done in virt-manager it seems.

That´s what I was thinking as well.

Thanks for making that clear :thumbsup:.

Thanks also for providing the new link. Taking the method provided there as an example I tried:

qemu-system-x86_64 -drive format=raw,media=cdrom,readonly,file=easy-4.3.4-amd64.img

… but the “no bootable device” error still appeared:

So that would leave me with

Yet taking all that into account I still fear the img file provided by EasyOS would not work unless it´s actually installed on a drive. … like I did when I installed it on the thumb drive.

I guess the solution would lie in installing EasyOS on a drive … but not on a physical one but on a “virtual” one.
No idea whether (and how) that can be accomplished at all… :thinking:

Thanks a lot for your kind help, Neville. :heart:

Many greetings
Rosika :slightly_smiling_face:

1 Like

@Rosika
And that my friend is the difference between Puppy Linux and EasyOS, I actually had EasyOS booting with VirtualBox with a Gentoo host. EasyOS did boot, but then started searching for drivers, that are not their, EasyOS by design, was made to boot from either a USB device or a SSD card, with laptops mostly.
Puppy Linux, on the other hand, still offers .iso’s, and will still boot using VirtualBox, or a virtual device. I have Puppy Linux running now with a Gentoo host, with VirtualBox.

1 Like

Yes, there is no loop mount . You could check the UUID for root filesystem is correct. Other than that I cant suggest much because I do not understand it.


Never mind. At least I was successful in creating the following entry in 40_custom and this one worked: 

That is great. At least that mint example worked. You will find that technique useful. We may even be able to make it work for EasyOS

The grub menu however has still the entry generated by grub-imageboot.
I´m not entirely sure how to get rid of that…

You can edit it out of grub.cfg… temporary fix, it will return on doing update-grub
Or you can in /etc/grub.d remove the 60_custom file… permanent but only effective after update-grub

Taking the method provided there as an example I tried:

qemu-system-x86_64 -drive format=raw,media=cdrom,readonly,file=easy-4.3.4-amd64.img

… but the “no bootable device” error still appeared:

I think you need to do the loop mount, and then say media=/dev/loop0
Might also need file=/mnt/rosika/easy2
Do some experiments

Dont give up. You are nearly there.
It puzzles me that virt-manager does not provide for using a loop device? Maybe it is somewhere other than the usb device menu?

Regards
Neville

PS… from qemu man page

 Block device options

The QEMU block device handling options have a long history and have gone through several iterations as the feature set and complexity of the block layer have grown. Many online guides to QEMU often reference older and deprecated options, which can lead to confusion.

The recommended modern way to describe disks is to use a combination of -device to specify the hardware device and -blockdev to describe the backend. The device defines what the guest sees and the backend describes how QEMU handles the data.

-fda file
-fdb file
    Use file as floppy disk 0/1 image (see the Disk Images chapter in the System Emulation Users Guide).
-hda file
-hdb file
-hdc file
-hdd file
    Use file as hard disk 0, 1, 2 or 3 image (see the Disk Images chapter in the System Emulation Users Guide).
-cdrom file
    Use file as CD-ROM image (you cannot use -hdc and -cdrom at the same time). You can use the host CD-ROM by using /dev/cdrom as filename

So maybe you need hda file ??
Would you describe EasyOS as a floppy disk image, a hard disk imsge, or a cdrom image? i think its a hd image?
I wish I knew qemu.

PPS
How does virt-manager know that a device is an actual usb drive, and an you use a link to fool it?

@nevj
With VirtualBox the command is " VBoxManage convertfromraw --format VDI easy-4.3.4-amd64.img easy-4.3.4-amd64.vdi ". Or to the version of easy downloaded.
One has to cd to the location the .img file was downloaded to, usually to " Downloads "
run the command and then use chown to change the owner of the " .vdi file "
This is a Linux command and will not work with Windows and VirtualBox has to be installed.

1 Like

Thanks Daniel, :+1:

I guess that wraps it up then.

Many greetings
Rosika :slightly_smiling_face:

So in Vbox, you just convert the .img file to a .vdi file. Simple. I wonder does qemu have some internal file type like .vdi that you can convert to?

That is true, but it should not stop it booting from a loop mount. A loop mount is like a virtual usb drive. It should work the same

1 Like

@Rosika
This tutorial has some good explanations of using -hda

Neville

1 Like

@nevj
Like I said, I had EasyOS booting with VirtualBox in a Gentoo host. It booted and started searching for drivers, probably for the video driver, after about 30 minutes of blinking, I finally gave up. You have VB installed, download easy and give it a try.
https://distro.ibiblio.org/easyos/amd64/releases/dunfell/
Grub cannot boot something it cannot find.

@Rosika does not want to yse VB, she wants qemu.
we have to find a way to make qemu see a loop mount of the EasyOS img file

1 Like

Thanks a lot, Neville, :heart:

You certainly understand much more than I do. :+1:

I see. Thanks for the help.
Well, I was not confident enough to remove the 60_custom file without talking to you first.
Glad to see I´m allowed to do that.

No luck there either:
After mounting lsblk told me:


loop0       7:0    0   825M  1 loop 
├─loop0p1 259:0    0     7M  1 part 
└─loop0p2 259:1    0   816M  1 part /media/rosika/easy2

so I tried:

  • qemu-system-x86_64 -drive format=raw,media=cdrom,readonly,media=/dev/loop0
  • qemu-system-x86_64 -drive format=raw,media=cdrom,readonly,media=/dev/loop0p2

Both yielded:

qemu-system-x86_64: -drive format=raw,media=cdrom,readonly,media=/dev/loop0p2: ‘/dev/loop0[p2]’ invalid media

… even with sudo.

Then I tired putting in file instead of media in the command.

qemu-system-x86_64 -drive format=raw,media=cdrom,readonly,**file**=/dev/loop0

qemu-system-x86_64: -drive format=raw,media=cdrom,readonly,file=/dev/loop0: Could not open '/dev/loop0': Permission denied

So i tried it with sudo again:

This way it started but I got stuck with the same error message as in post #64 : “no bootable device”.

Thanks, Neville, for doing research on my behalf. :heart:

Actually this one took me a bit further. :+1:

kvm -hda easy-4.3.4-amd64.img -cpu host -m 1024 -boot d

I arrived at this:

… but here it got stuck. Wouldn´t do anything else that putting my cpu under heavy load.
So I aborted.

Here´s what the terminal had to say:

WARNING: Image format was not specified for 'easy-4.3.4-amd64.img' and probing guessed raw.
         Automatically detecting the format is dangerous for raw images, write operations on block 0 will be restricted.
         Specify the 'raw' format explicitly to remove the restrictions.

That´s all. :frowning_face:

Hmm, all I can say is what file tells me:

file easy-4.3.4-amd64.img
easy-4.3.4-amd64.img: DOS/MBR boot sector

So we´re not much wiser…

No idea but I´ll try to investigate further. Thanks for the hint.

Thanks for the link as well. I´ll look into it.

Many greetings
Rosika :slightly_smiling_face:

@nevj
I understand, but qemu and VB work within the same parameters, virtual drives, if you can make it work in VB then it will probably work with qemu.
Have you tried converting the easy.img file to an .iso file?

That is a disk image. It has an MBR.
So -hda /dev/loop0 is close to correct.
Must need some of the other options changed
Did you try specifying raw format?

You are close.
Neville

1 Like

Actually I used the command
kvm -hda easy-4.3.4-amd64.img -cpu host -m 1024 -boot d

Sorry; I added this info a bit later as I forgot to post it.

Now I tried what you suggested:

sudo kvm -hda /dev/loop0 -cpu host -m 1024 -boot d
qemu-system-x86_64: -hda /dev/loop0: The device is not writable: Permission denied

And I guess that´s the crucial part:

The device is not writable

As EasyOS is intended to be written to a disk/stick/card the device has to offer writing capabilities. As soon as EasyOS starts it begins to write (I don´t know exactly what) and this is permanent.
So it seems a loop device wouldn´t work.

I guess that´s it then. It has to be flash drive it seems. :frowning_face:

Thanks so much. Neville. :heart:

Many greetings from Rosika :slightly_smiling_face:

If it’s a simple disk image like the ones used for Raspberry Pis, then you just need a virtual drive as suggested earlier, flash the image onto it and then boot from that.

Why cant a loop mount be rw?

Are you saying make an empty virtual drive with qemu, then write the image onto it, then boot from that with qemu?
How is that different from loop mounting the original image file and booting from the loop device?