Running the Qemu image


#14

A qcow2 image must be converted with the tool qemu-img to VDI, i.e.

qemu-img convert -O vdi qemu-x86_64.qcow2 qemu-x86_64.vdi

but doing this, the VB crashes on boot;

A raw image could be converted with VB itself, like:

VBoxManage convertdd raw.img VBox.vdi --format VDI

Do we have a raw image?


#15

Yes, the raw image has the .img.xz extension, so it will need decompressing with the xz tool first.

Here’s a build that is currently available: Build #2050.


#16

So i don’t know if this workaround is expected to work?

So i downloaded the raw .img.xz and successfully decompressed it.
I successfully converted it to a .vdi via the command:

VBoxManage convertfromraw qemu-x86_64.img qemu-x86_64.vdi --format VDI

When I start the virtualbox from the .vdi I see the correct grub screen, and can select the boot-record, however the magic stops here.
It just hangs in a black screen with a cursor blinking, I don’t know if I have to make some other settings or so.

This is not so much of a post to get help, more for curiosity and to inform that it is at least not working out of the box.
(I use the qcow2 format without any problems with qemu)


#17

I did the same and have the same problem: only a dark screen with blinking cursor line. The system is up, because if you use Alt+F1 you are switching to tty1 and a login is there, same is true for Alt+F2 … Alt+F6. After 2-3 secs it switches back to (perhaps) tty7 where the X should be running, but this is somehow not up. I’m struggling since 1-2 hours to get the network of the VB guest up (without any luck so far), to be able to SSH into the guest and see what the problem is.

Is there some way, that the “phosh” is not launched on start, to be able to login on tty1 and start it manually?

Someone from Purism should please dig into that or help me to get the feet into the door.


#18

I verified that the .img image from Build #2050 works in qemu with this command:

qemu-system-x86_64 -boot menu=on -drive file=qemu-x86_64.img,format=raw -vga virtio -display gtk -m 3G -enable-kvm -device e1000,netdev=net0 -netdev user,id=net0,hostfwd=tcp::5555-:22

So maybe there’s something strange with VirtualBox. Do you need to have some extensions enabled for graphics and networking?


#19

The same VB configuration boots fine any Ubuntu-17.10 iso image into graphical mode.

It does not help much, that you say “boots fine with qemu” and we both (Rhodez-x and I) have the same problem with VB. Wouldn’t it be better to download some VB and test the image within VB? Or, to give me a hint how to start the system without starting auto the phosh? Thanks.


#20

Well, running the image in qemu helps to establish that the image isn’t completely broken.

I used a lot of time today trying to figure out how to get VirtualBox running on Debian 10 and ultimately failed, both using unofficial packages and ones from virtualbox.org. Someone with more experience of VirtualBox will need to provide assistance at this point.


#21

Yeah, VirtualBox is a strange thing.
I know that Mac OS also is a strange thing. I have tried all day to make a MacOS virtualbox. But I did fail too, after many attempts.

@guru I don’t think that it is just a little thing missing for it to get working.
This can take days/weeks/months to debug. I guess you already know that. I do agree that a hint could be nice.
But I don’t think the time investment is worth it at the moment.

I think the problem with qemu and mouse support would be a easier problem to solve, without knowing anything of the problem.


#22

However the installation of VirtualBox itself should not be that bad in Debian 10:

sudo apt-get update
sudo apt-get upgrade
wget -q https://www.virtualbox.org/download/oracle_vbox_2016.asc -O- | sudo apt-key add
wget -q https://www.virtualbox.org/download/oracle_vbox.asc -O- | sudo apt-key add

if add-apt-repository is not already installed, it is in this pakages:

sudo apt install software-properties-common

And then add the repository:

sudo add-apt-repository "deb http://download.virtualbox.org/virtualbox/debian buster contrib"
sudo apt update

I haven’t tested how the converted .img -> .vdi works in VB on Debian. That must be a task for tomorrow.


#23

Well, installing it wasn’t the problem. Installing it successfully turned out to be the hard part - see below. :frowning_face:

Anyway, thanks for the instructions. I made another attempt to install it from the virtualbox.org repository and faced the same errors about kernel headers:

This system is currently not set up to build kernel modules.
Please install the Linux kernel "header" files matching the current kernel
for adding new hardware support to the system.
The distribution packages containing the headers are probably:
    linux-headers-amd64 linux-headers-4.16.0-2-amd64

So something is a bit off with my kernel, it seems.


#24

I just realised… you don’t have GL on the display option? My command is as follows, with the image being renamed to PureOS1.qcow2 for version differentiation, and works perfectly with mouse support:

sudo qemu-system-x86_64 -boot menu=on -drive file=PureOS1.qcow2,format=qcow2 -vga virtio -display gtk,gl=on -smp cores=4 -m 3G -enable-kvm -net nic -net user -monitor stdio

Speaking of sliding, phosh does not seem to support it (although the lockscreen does, upon further testing), in case that ends up being confusing. It certainly threw me off at first…


#25

I did as root:

qemu-system-x86_64 -boot menu=on -drive file=qemu-x86_64.qcow2,format=qcow2 -vga virtio -display gtk,gl=on -m 1G -net nic -net user -monitor stdio

(on FreeBSD -enable-kvm isn’t supported, that’s why all is very slow in qemu, it takes minutes to boot)

Same result: no mouse.


#26

I booted the VB and with difficulties I managed to login on tty1 (the problem is that the system jumps back always after 1-3 secs to tty7 where the cursor blinks, so typing is not that easy). I could even fire up there ps ax > file and look into the processes.

How the phosh process is named, to kill it and get a stable bash session to look around?

I started also a thread in the FreeBSD Vbox mailing list
freebsd-emulation@freebsd.org to discuss this issue there…


#27

You should be able to stop phosh with this:

sudo systemctl stop phosh

#28

Yep, this worked and I have now a stable session on any tty1…6.
When I start as root phosh again (to see in the tty1 the errors) it says:

pci id for fd 9: 80ee:beef, driver (null) (process;1229): phoc-wlroots-CRITICAL **: 06:49:41.506: [src/main.c:178] Unable to open wayland socket: No such file or directory
I can restart it with systemctl start phosh and I’m again in the same situation as after boot: black screen on tty7 and system always jumps back to this. On tty1 from where I did the restart are no messages. Where I could find the messages from phosh?


#29

Use journalctl to see this. Something like this:

sudo journalctl -u phosh -xe

I don’t remember the exact options. See the Debugging page for links.


#30

Rhodez-x, can you please post the VB version. I learned in my tests that the system is using wayland server and it looks like that wayland is not supported in my VB version 5.2.22.


#31

So I have some news.

I am using VirtualBox version: “6.0.10 r132055”.
A cording to this forum thread: https://forums.virtualbox.org/viewtopic.php?f=7&t=92133

Wayland has had a bug, which might have been why I could not launch the graphics.
When I tested in my previous post I had version 6.0.3, which had the “Wayland bug”, it is now fixed
in the new release, and the beautiful Phosh is now launching correct.


#32

Don’t know if I should mention that i have set the graphics controller to: VMSVGA)


How do I get Librem 5 in ISO image format to test on VirtualBox?
#33

does anyone know what the settings are for hearing the sound? I can not make it