Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: ensure FreeBSD support is a good as it can be #926

Closed
Marietto2008 opened this issue Feb 12, 2024 · 25 comments
Closed

feat: ensure FreeBSD support is a good as it can be #926

Marietto2008 opened this issue Feb 12, 2024 · 25 comments
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@Marietto2008
Copy link

ziomario@Z390-AORUS-PRO-DEST:~$ quickget freebsd 14.0

[#7252fe 1.0GiB/1.0GiB(99%) CN:1 DL:9.1MiB]                                                                                           
Checking freebsd-14.0-disc1/FreeBSD-14.0-RELEASE-amd64-disc1.iso with sha256sum... Good!
Making freebsd-14.0-disc1.conf
Giving user execute permissions on freebsd-14.0-disc1.conf,

To start your FreeBSD virtual machine run:
    quickemu --vm freebsd-14.0-disc1.conf

ziomario@Z390-AORUS-PRO-DEST:~$ quickemu --vm freebsd-14.0-disc1.conf

Quickemu 4.9.1 using /usr/local/bin/qemu-system-x86_64 v7.2.50
 - Host:     Ubuntu 23.10 running Linux 6.5 (Z390-AORUS-PRO-DEST)
 - CPU:       Intel(R) Core(TM) i9-9900K CPU @ 3.60GHz
 - CPU VM:   1 Socket(s), 4 Core(s), 2 Thread(s), 8G RAM
 - BOOT:     EFI (Freebsd), OVMF (/usr/share/OVMF/OVMF_CODE.fd), SecureBoot (off).
 - Disk:     freebsd-14.0-disc1/disk.qcow2 (16G)
             Just created, booting from freebsd-14.0-disc1/FreeBSD-14.0-RELEASE-amd64-disc1.iso
 - Boot ISO: freebsd-14.0-disc1/FreeBSD-14.0-RELEASE-amd64-disc1.iso
 - Display:  SDL, qxl-vga, GL (on), VirGL (off)
 - Sound:    intel-hda
 - ssh:      On host:  ssh user@localhost -p 22220
 - WebDAV:   On guest: dav://localhost:9843/
 - 9P:       On guest:  - smbd:     On guest: smb://10.0.2.4/qemu
 - Network:  User (virtio-net)
 - Monitor:  On host:  nc -U "freebsd-14.0-disc1/freebsd-14.0-disc1-monitor.socket"
             or     :  socat -,echo=0,icanon=0 unix-connect:freebsd-14.0-disc1/freebsd-14.0-disc1-monitor.socket
 - Serial:   On host:  nc -U "freebsd-14.0-disc1/freebsd-14.0-disc1-serial.socket"
             or     :  socat -,echo=0,icanon=0 unix-connect:freebsd-14.0-disc1/freebsd-14.0-disc1-serial.socket
audio: Could not init `pa' audio driver
cat: freebsd-14.0-disc1/freebsd-14.0-disc1.pid: No such file or directory
 - Process:  Starting freebsd-14.0-disc1.conf as freebsd-14.0-disc1 ()
@zen0bit
Copy link
Contributor

zen0bit commented Feb 12, 2024

Could not init `pa' audio driver
pulse audio?

@Marietto2008 Marietto2008 changed the title cat: freebsd-14.0-disc1/freebsd-14.0-disc1.pid: No such file or directory Could not init `pa' audio driver while trying to create a FreeBSD 14.0 vm on top of Ubuntu 23.10. Feb 12, 2024
@Marietto2008
Copy link
Author

Marietto2008 commented Feb 12, 2024

I think that the problem is that I'm using pipewire...

# ps ax | grep pulse
   2889 ?        S<Lsl   0:17 /usr/bin/pipewire-pulse
   3361 tty2     Sl+    0:01 /usr/lib/x86_64-linux-gnu/xfce4/panel/wrapper-2.0 /usr/lib/x86_64-linux-gnu/xfce4/panel/plugins/libpulseaudio-plugin.so 8 18874384 pulseaudio

@Marietto2008
Copy link
Author

as root I get a different error :

root@Z390-AORUS-PRO-DEST:/home/ziomario/Scaricati/Whisper# quickget freebsd 14.0

[#a742bf 1.0GiB/1.0GiB(99%) CN:2 DL:9.1MiB]                                                                                           
Checking freebsd-14.0-disc1/FreeBSD-14.0-RELEASE-amd64-disc1.iso with sha256sum... Good!
Making freebsd-14.0-disc1.conf
Giving user execute permissions on freebsd-14.0-disc1.conf,

To start your FreeBSD virtual machine run:
    quickemu --vm freebsd-14.0-disc1.conf

root@Z390-AORUS-PRO-DEST:/home/ziomario/Scaricati/Whisper# quickemu --vm freebsd-14.0-disc1.conf

Quickemu 4.9.1 using /usr/local/bin/qemu-system-x86_64 v7.2.50
 - Host:     Ubuntu 23.10 running Linux 6.5 (Z390-AORUS-PRO-DEST)
 - CPU:       Intel(R) Core(TM) i9-9900K CPU @ 3.60GHz
 - CPU VM:   1 Socket(s), 4 Core(s), 2 Thread(s), 8G RAM
 - BOOT:     EFI (Freebsd), OVMF (/usr/share/OVMF/OVMF_CODE.fd), SecureBoot (off).
 - Disk:     freebsd-14.0-disc1/disk.qcow2 (16G)
             Just created, booting from freebsd-14.0-disc1/FreeBSD-14.0-RELEASE-amd64-disc1.iso
 - Boot ISO: freebsd-14.0-disc1/FreeBSD-14.0-RELEASE-amd64-disc1.iso
 - Display:  SDL, qxl-vga, GL (on), VirGL (off)
 - Sound:    intel-hda
 - ssh:      On host:  ssh user@localhost -p 22220
 - WebDAV:   On guest: dav://localhost:9843/
 - 9P:       On guest:  - smbd:     On guest: smb://10.0.2.4/qemu
 - Network:  User (virtio-net)
 - Monitor:  On host:  nc -U "freebsd-14.0-disc1/freebsd-14.0-disc1-monitor.socket"
             or     :  socat -,echo=0,icanon=0 unix-connect:freebsd-14.0-disc1/freebsd-14.0-disc1-monitor.socket
 - Serial:   On host:  nc -U "freebsd-14.0-disc1/freebsd-14.0-disc1-serial.socket"
             or     :  socat -,echo=0,icanon=0 unix-connect:freebsd-14.0-disc1/freebsd-14.0-disc1-serial.socket
qemu-system-x86_64: -netdev user,hostname=freebsd-14.0-disc1,hostfwd=tcp::22220-:22,smb=/root/Pubblici,id=nic: network backend 'user' is not compiled into this binary

@TuxVinyards
Copy link
Contributor

I am not seeing this as an issue. It doesn't replicate.

Mario, your system looks in serious need of security updates.

You are running qemu 7.2.5 while the current version on Ubuntu 23,10 is now at 8.0.4 ...

You shouldn't being running things in root either. Certainly not quickemu.

Update your computer. Test that a VM of Ubuntu 23.10 will work on your Ubuntu HOST. Then try FreeBSD. Also try the DVD version too.

freebsd-boots

@Marietto2008
Copy link
Author

Marietto2008 commented Feb 13, 2024

I don't know why,but I had two qemu-system-x86_64 executable versions installed and the default one was the older.
I have exchanged them and I'm using the newer one. No,I won't run quickemu as root. If you read well my previous messages you will see that I tried to launch the vm using the normal user and root,to show that I'd got two different errors. Anyway,now I have installed FreeBSD 14.0 using these specs :

ziomario@Z390-AORUS-PRO-DEST:~/Scaricati/OS$ quickemu --vm freebsd-14.0-disc1.conf

Quickemu 4.9.1 using /usr/local/bin/qemu-system-x86_64 v8.0.4

  • Host: Ubuntu 23.10 running Linux 6.5 (Z390-AORUS-PRO-DEST)
  • CPU: Intel(R) Core(TM) i9-9900K CPU @ 3.60GHz
  • CPU VM: 1 Socket(s), 4 Core(s), 2 Thread(s), 8G RAM
  • BOOT: EFI (Freebsd), OVMF (/usr/share/OVMF/OVMF_CODE.fd), SecureBoot (off).
  • Disk: freebsd-14.0-disc1/disk.qcow2 (16G)
  • Display: SDL, qxl-vga, GL (on), VirGL (off)
  • Sound: intel-hda
  • ssh: On host: ssh user@localhost -p 22220
  • WebDAV: On guest: dav://localhost:9843/
  • 9P: On guest: - smbd: On guest: smb://10.0.2.4/qemu
  • Network: User (virtio-net)
  • Monitor: On host: nc -U "freebsd-14.0-disc1/freebsd-14.0-disc1-monitor.socket"
    or : socat -,echo=0,icanon=0 unix-connect:freebsd-14.0-disc1/freebsd-14.0-disc1-monitor.socket
  • Serial: On host: nc -U "freebsd-14.0-disc1/freebsd-14.0-disc1-serial.socket"
    or : socat -,echo=0,icanon=0 unix-connect:freebsd-14.0-disc1/freebsd-14.0-disc1-serial.socket
  • Process: Starting freebsd-14.0-disc1.conf as freebsd-14.0-disc1 (74556)

Can I ask for some improvements to be added by default ? For example :

  1. everytime I want to work inside the vm I should press CTRL+ALT+G to release the mouse cursor. Is there a way to avoid the usage of these keys ? It's annoying to press them everytime I want to switch from the host os to the guest os,maybe using the qemu parameter : -usb -device usb-kbd -device usb-tablet (to enable the EvTouch USB Tablet,instead of : -device usb-mouse,bus=input.0)

    • Display: qxl-vga : it does not work :

Istantanea_2024-02-13_12-40-27

  1. VirGL (off) : why VirGL is off ? FreeBSD can support VirGL. Would be nice to use it. So please,enable it by default on qemu.

@TuxVinyards
Copy link
Contributor

Ctrl Alt G is part of the SDL window. You can also try Spice. Shift F12. It's the way you SSH into the display server ... It's the same with all VM's.

There's no obligation to use qqX but using this as a front end makes this all a lot easier. You can easily switch displays and lots of other things.

I am currently finishing up on a system that allows you to easily customise your boot scripts too. Out probably next week. If not before.

@Marietto2008
Copy link
Author

Marietto2008 commented Feb 13, 2024

---> Ctrl Alt G is part of the SDL window. You can also try Spice. Shift F12. It's the way you SSH into the display server ... It's the same with all VM's.

Maybe I didn't explain well. Even if I press SHIFT F12,it's annoying the same,because everytime I want to switch from the host os to the guest,I should press those keys. Instead,using "-usb -device usb-kbd -device usb-tablet" the mouse makes some kind of passthrough between them,without the obligation to press those keys.

---> There's no obligation to use qqX but using this as a front end makes this all a lot easier. You can easily switch displays and lots of other things.

It makes no sense to configure qemu with "Display: qxl-vga" if the driver does not work within FreeBSD. I'm sure that a different display (supported by qemu and FreeBSD) will enable startx and a decent windows manager like xfce to work well. Inside FreeBSD there is the driver called "xf86-video-vmware" ; If I remember well,qemu also supports the vmware driver.

If you want to recompile qemu and enable virGL on your quickemu by default,I wil do the rest,I mean I will try to configure it within FreeBSD.

@zen0bit
Copy link
Contributor

zen0bit commented Feb 13, 2024

Maybe I didn't explain well. Even if I press SHIFT F12,it's annoying the same,because everytime I want to switch from the host os to the guest,I should press those keys. Instead,using "-usb -device usb-kbd -device usb-tablet" the mouse makes some kind of passthrough between them,without the obligation to press those keys.

Are you look at barrier?
Work with different devices, so with VMs also (freeBSD ports also available)

That maybe solve you annoyance
PS: Don't now that usb -device usb-kbd -device usb-tablet

@Marietto2008
Copy link
Author

Marietto2008 commented Feb 13, 2024

Yes,I know barrier. But do you want that I pass from the annoyance A to the annoyance B ? Barrier should be configured everytime I (we) want to create a new vm. More than one problem for me,I'm trying to explain to you how you can make the life easier to everyone who wants to use your tool. For example,I've added the parameters below to the file : freebsd-14.0-disc1.sh and voila',there is no more need to press any key to pass the mouse from the host to the guest. Just try and see if it works. If it works,please add these values by default in the appropriate place of your tool. Don't think to what I can do to tweak your script,think what YOU can do to make a better product :

just add these :

-device usb-kbd \
-device usb-tablet \

and remove this :

-device usb-mouse,bus=input.0 \

@TuxVinyards
Copy link
Contributor

@Marietto2008 Learning something from you today, possibly. I didn't know it was actually possible to bypass the separated window thing. I was always under the impression that this is one of the key elements to VM isolation and sand-boxing. But we are running type 2 VM's here and host pass-through is enabled to some extent, I suppose.

You may be able to solve your current problem by using the .sh file that quickemu spits out into the VM folder. This file tends to cause a lot of confusion as Quickemu doesn't actually use it. But if you place a copy of it next to your .conf file and chmod +x, you can edit the device spec as per qemu invocation and boot from there.

I have noticed that you have been involved VM work on Arm processors. https://github.com/mobile-virt/arm-xen-kvm

marietto-kvm

The last bit of my work on custom scripts is getting Debian Arm ISO working with qqX. Then I need to make a Wiki, also explaining about how to do similar with RiscV, which I have already managed to do. You may be able to help, a bit later on, I think. 🤣

Quickemu is just a front end for Qemu. It does have it's flaws. We are currently working on how to make it the code better. If you would like to contribute, there's a lengthy discussion that sprang up on the issue here: TuxVinyards/qqX#4

@Marietto2008
Copy link
Author

Marietto2008 commented Feb 13, 2024

Yeah,after a long training to learn how to virtualize any OS available for the x86_64 cpus using almost all the tools available,I have switched to the arm cpus to continue to have fun. Qemu-kvm is the first choice,but later I discovered how fun is to play with bhyve under FreeBSD and xen under arm 32 and arm 64. Actually I'm trying to boot FreeBSD as a domU when dom0 is Devuan,on my old ARMv7 Chromebook. Unfortunately it seems that xen is bugged and can't boot FreeBSD. No problems for Linux. I've bought the Raspberry p 4B because I want to do the same experiment there. Maybe I will be luckier with Arm 64 bit. I'm also working on a more interesting project. I've bought some old smartphones with Android preinstalled. These phones are special because we can bypass the bootloader protection and we can virtualize FreeBSD with kvm or xen,leaving 1 core for Android and the rest will go to FreeBSD. I love FreeBSD,I want to put it everywhere :D

@Marietto2008
Copy link
Author

Marietto2008 commented Feb 13, 2024

Coming back to your quickemu,I tried to point your attention to these two points below,but you have ignored them,but I find it interesting to talk about them :

---> It makes no sense to configure qemu with "Display: qxl-vga" if the driver does not work within FreeBSD. I'm sure that a different display (supported by qemu and FreeBSD) will enable startx and a decent windows manager like xfce to work well. Inside FreeBSD there is the driver called "xf86-video-vmware" ; If I remember well,qemu also supports the vmware driver.

---> If you want to recompile qemu and enable virGL on your quickemu by default,I wil do the rest,I mean I will try to configure it within FreeBSD.

Those are two great improvements for your quickemu that will make the life easier for the FreeBSD users. Do you want to collaborate in this area ?

Infact quickemu tells me that VirGL is off by default. I think you should use the qemu installed on the users PC and recompile it to enable it by default :

Display: SDL, qxl-vga, GL (on), VirGL (off)

@TuxVinyards
Copy link
Contributor

Coming back to your quickemu,I tried to point your attention to these two points below,but you have ignored them,but I find it interesting to talk about them :

---> It makes no sense to configure qemu with "Display: qxl-vga" if the driver does not work within FreeBSD. I'm sure that a different display (supported by qemu and FreeBSD) will enable startx and a decent windows manager like xfce to work well. Inside FreeBSD there is the driver called "xf86-video-vmware" ; If I remember well,qemu also supports the vmware driver.

Quickemu doesn't normally use qxl-vga when booting the VMs. It must be something to do with the way Wimpy / @flexiondotorg has set things up to work with FreeBSD. Unfortunately Wimpy seems to be being pulled in too many directions these days .... This why I said about a using a custom boot and about the discussion that some of us are currently having about ways to move forward. Your point is noted about QXL. Although, when I tried, evidence in screenshot, QXL loaded and seemed to work fine for me (?)

---> If you want to recompile qemu and enable virGL on your quickemu by default,I wil do the rest,I mean I will try to configure it within FreeBSD.

Those are two great improvements for your quickemu that will make the life easier for the FreeBSD users. Do you want to collaborate in this area ?

The basic idea that Wimpy had was to make a simple front end script that used standard everyday builds and got most things working. I haven't the foggiest idea whether VirGL is enabled or not 🤣 I am just using the standard Ubuntu build. I haven't had any problems so far.

@Marietto2008
Copy link
Author

---> Your point is noted about QXL. Although, when I tried, evidence in screenshot, QXL loaded and seemed to work fine for me (?)

It worked for you under FreeBSD 14.0-RELEASE ?

---> I am just using the standard Ubuntu build.

I'm talking about the specific configuration for FreeBSD 14-RELEASE,that's different than the one for Ubuntu.

@zen0bit
Copy link
Contributor

zen0bit commented Feb 13, 2024

I'm talking about the specific configuration for FreeBSD 14-RELEASE,that's different than the one for Ubuntu.

So 13.3 and lower are not affected? @Marietto2008

@zen0bit
Copy link
Contributor

zen0bit commented Feb 13, 2024

Quickemu 4.9.1 using /usr/bin/qemu-system-x86_64 v8.1.3
 - Host:     "Void Linux" running Linux 6.6 (drak)
 - CPU:       AMD Ryzen 7 5700G with Radeon Graphics
 - CPU VM:   1 Socket(s), 4 Core(s), 2 Thread(s), 16G RAM
 - BOOT:     EFI (Freebsd), OVMF (/usr/share/qemu/edk2-x86_64-code.fd), SecureBoot (off).
 - Disk:     freebsd-14.0-disc1/disk.qcow2 (16G)
             Just created, booting from freebsd-14.0-disc1/FreeBSD-14.0-RELEASE-amd64-disc1.iso
 - Boot ISO: freebsd-14.0-disc1/FreeBSD-14.0-RELEASE-amd64-disc1.iso
 - Display:  SDL, qxl-vga, GL (on), VirGL (off)
 - Sound:    intel-hda
 - ssh:      On host:  ssh user@localhost -p 22220
 - WebDAV:   On guest: dav://localhost:9843/
 - 9P:       On guest:  - Network:  User (virtio-net)
 - Monitor:  On host:  nc -U "freebsd-14.0-disc1/freebsd-14.0-disc1-monitor.socket"
             or     :  socat -,echo=0,icanon=0 unix-connect:freebsd-14.0-disc1/freebsd-14.0-disc1-monitor.socket
 - Serial:   On host:  nc -U "freebsd-14.0-disc1/freebsd-14.0-disc1-serial.socket"
             or     :  socat -,echo=0,icanon=0 unix-connect:freebsd-14.0-disc1/freebsd-14.0-disc1-serial.socket
pulseaudio: pa_context_connect() failed
pulseaudio: Reason: Connection refused
pulseaudio: Failed to initialize PA contextaudio: Could not init `pa' audio driver
cat: freebsd-14.0-disc1/freebsd-14.0-disc1.pid: No such file or directory
 - Process:  Starting freebsd-14.0-disc1.conf as freebsd-14.0-disc1 ()

Trying...

@zen0bit
Copy link
Contributor

zen0bit commented Feb 13, 2024

@Marietto2008 You should be able to use any commands with quickemu

As in README.md
--extra_args : Pass additional arguments to qemu

So if you have qemu builded with support, here shouldn't be problem.

But freebsd 14 is evidently bugged..
(Not tried other versions)
Thanks for report ❤️

@Marietto2008
Copy link
Author

Marietto2008 commented Feb 13, 2024

So,for 14-RELEASE,maybe this works :

-device vmware-svga,id=video0,vgamem_mb=16,bus=pcie.0,addr=0x2

in any case,again,don't ask me to add a new parameter by my side. If the goal of your tool is to offer pre made configurations for a fast usage,you should add it by YOUR side.

@zen0bit
Copy link
Contributor

zen0bit commented Feb 13, 2024

In any case,again,don't ask me to add a new parameter by my side.

sure

just solution meanwhile will be resolved upstream

PS: I am thinking about anyone reading this trying freebsd...

PPS: I am pretty sure that you don't need quickemu at all...

PPPS: Not really "my" tool, but I am contributing 😉

@Marietto2008
Copy link
Author

Marietto2008 commented Feb 14, 2024

For FreeBSD 14-RELEASE,this parameter works good :

-device vmware-svga,id=video0,vgamem_mb=16,bus=pcie.0,addr=0x2

Istantanea_2024-02-14_01-19-59

anyway,I don't know the reason why it is frozen. The mouse does not work. I think the freezing is tied to the "parallel0 console"

@Marietto2008
Copy link
Author

---> PPS: I am pretty sure that you don't need quickemu at all...

I can use it if it will work as I want...

@zen0bit
Copy link
Contributor

zen0bit commented Feb 14, 2024

Not touched quickemu to much yet so I am not familiar with. But I have to learn it anyway so I will investigate more...

PS: But since we can't merge any PR without @flexiondotorg. It isn't only on me and @TuxVinyards

@zen0bit
Copy link
Contributor

zen0bit commented Feb 14, 2024

For FreeBSD 14-RELEASE,this parameter works good :

-device vmware-svga,id=video0,vgamem_mb=16,bus=pcie.0,addr=0x2

Istantanea_2024-02-14_01-19-59

anyway,I don't know the reason why it is frozen. Mouse does not work. I think the freezing is tied to the "parallel0 console"

So work good or is frozen?
quickemu ouput while runned this?

@zen0bit
Copy link
Contributor

zen0bit commented Feb 14, 2024

But you didn't answer my question (or I missed that?)

Is it affecting more versions (BSDs), or only freebsd 14.0?

You tried older/different BSD or not?
PS: Thanks for pation anyway 🍺

@Marietto2008
Copy link
Author

Marietto2008 commented Feb 14, 2024

I didn't try if qxl works with 13.2,but who cares if vmware-svga works better ? :D

@flexiondotorg flexiondotorg changed the title Could not init `pa' audio driver while trying to create a FreeBSD 14.0 vm on top of Ubuntu 23.10. feat: ensure FreeBSD support is a good as it can be May 9, 2024
@flexiondotorg flexiondotorg added enhancement New feature or request help wanted Extra attention is needed labels May 9, 2024
flexiondotorg added a commit that referenced this issue May 12, 2024
The display resolution can be set using `--width` and`--height` for macOS and *BSD.
- close #926
- close #1202
philclifford pushed a commit to philclifford/quickemu that referenced this issue May 13, 2024
The display resolution can be set using `--width` and`--height` for macOS and *BSD.
- close quickemu-project#926
- close quickemu-project#1202
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

4 participants