Docker-OSX icon indicating copy to clipboard operation
Docker-OSX copied to clipboard

Running in Fedora 39 with podman

Open petasis opened this issue 1 year ago • 13 comments

OS related issued, please help us identify the issue by posting the output of this

Linux fedser-aero 6.6.8-200.fc39.x86_64 #1 SMP PREEMPT_DYNAMIC

In order to get it run under fedora 39, I had to add this additional option: --security-opt label=type:container_runtime_t.

docker run -it \
    --device /dev/kvm \
    -p 50922:10022 \
    -v /tmp/.X11-unix:/tmp/.X11-unix \
    -e "DISPLAY=${DISPLAY:-:0.0}" \
    -e GENERATE_UNIQUE=true \
    -e MASTER_PLIST_URL='https://raw.githubusercontent.com/sickcodes/osx-serial-generator/master/config-custom.plist' \
    --security-opt label=type:container_runtime_t \
    sickcodes/docker-osx:monterey

petasis avatar Dec 28 '23 19:12 petasis

I couldn't quite get your code to work above however, the following managed to work for me in Fedora 39 Gnome Wayland and Nobara 39 KDE Wayland.

The following command is necessary after every reboot;

sudo chmod 777 $XDG_RUNTIME_DIR/wayland-*

Then the following working for me

podman run -it \
    --device /dev/kvm --device /dev/snd \
    -p 50922:10022 \
    -v $XDG_RUNTIME_DIR/$WAYLAND_DISPLAY:/tmp/$WAYLAND_DISPLAY \
    -e WAYLAND_DISPLAY="${WAYLAND_DISPLAY:-wayland-0}" -e DISPLAY=":1" \
    -e GENERATE_UNIQUE=true -e QT_QPA_PLATFORM=wayland \
    -e XDG_RUNTIME_DIR=/tmp -e GDK_BACKEND=wayland \
    -e CLUTTER_BACKEND=wayland \
    -e MASTER_PLIST_URL='https://raw.githubusercontent.com/sickcodes/osx-serial-generator/master/config-custom.plist' \
    --security-opt label=type:container_runtime_t \
    sickcodes/docker-osx:monterey

This worked for me after multiple attempts at trying to solve this.

alexjfinch avatar Jan 04 '24 00:01 alexjfinch

Further more the QEMU instance stops grabbing inputs after the instance starts running, usually after a couple of apps have opened. The machine hasn't crashed and continues to run as I can see the cursor blinking and iMessage updates, but for some reason the container no longer receives an input

I think its a ram related issue but yet to figure it out

UPDATE Managed to keep the machine running for 15 minutes now by only opening 1 app and assigning 5G of RAM - baremetal has 16GB RAM and I've closed as much as possible to free up RAM for allocation. I've also purged cache using the following shortly after the container span up;

sudo tee /proc/sys/vm/drop_caches <<< 3

alexjfinch avatar Jan 04 '24 13:01 alexjfinch

@alexjfinch

Thanks for this!! It works for me too. Solved some frustration :joy:

Crilum avatar Feb 03 '24 02:02 Crilum

Further update, managed to get Ventura working with the following;

podman run -it \
    --device /dev/kvm --device /dev/snd \
    -p 50922:10022 \
    -v $XDG_RUNTIME_DIR/$WAYLAND_DISPLAY:/tmp/$WAYLAND_DISPLAY \
    -e WAYLAND_DISPLAY="${WAYLAND_DISPLAY:-wayland-0}" -e DISPLAY=":1" \
    -e GENERATE_UNIQUE=true -e QT_QPA_PLATFORM=wayland \
    -e XDG_RUNTIME_DIR=/tmp -e GDK_BACKEND=wayland \
    -e CLUTTER_BACKEND=wayland \
    -e RAM=5 \
    -e CPU_STRING=6 \
    -e MASTER_PLIST_URL='https://raw.githubusercontent.com/sickcodes/osx-serial-generator/master/config-custom.plist' \
    --security-opt label=type:container_runtime_t \
    sickcodes/docker-osx:ventura

alexjfinch avatar Feb 03 '24 10:02 alexjfinch

Yeah, I tried that too, and it does work!

Crilum avatar Feb 03 '24 16:02 Crilum

Your suggested command above didn't work for me. Now I don't know if it's because my user has to be a mamber of some particular group for guestfish, or because I'm nit running Wayland (no support for Wayland in Cinnamon currently).

/var/tmp/opencore-image-ng.sh-102/EFI/OC/Tools
/var/tmp/opencore-image-ng.sh-102/EFI/OC/Tools/ResetSystem.efi
/var/tmp/opencore-image-ng.sh-102/EFI/OC/Tools/Shell.efi
libguestfs: trace: set_verbose true
libguestfs: trace: set_verbose = 0
libguestfs: trace: set_backend "direct"
libguestfs: trace: set_backend = 0
libguestfs: create: flags = 0, handle = 0x55a61fe1a2a0, program = guestfish
guestfish: /tmp/.guestfish-1000: Permission denied
libguestfs: trace: close
libguestfs: closing guestfs handle 0x55a61fe1a2a0 (state 0)
ERROR: starting guestfish failed
### cleaning up ...

This is with Fedora 39, podman version 4.9.3, guestfish 1.52, and the wayland libraries

libwayland-client-1.22.0-2.fc39.x86_64 libwayland-server-1.22.0-2.fc39.x86_64 libwayland-egl-1.22.0-2.fc39.x86_64 libwayland-cursor-1.22.0-2.fc39.x86_64 xisxwayland-2-3.fc39.x86_64 libwayland-client-1.22.0-2.fc39.i686 libwayland-cursor-1.22.0-2.fc39.i686 libwayland-server-1.22.0-2.fc39.i686 libwayland-egl-1.22.0-2.fc39.i686 qt6-qtwayland-6.6.0-1.fc39.x86_64 wayland-devel-1.22.0-2.fc39.x86_64 qt5-qtwayland-5.15.12-2.fc39.x86_64 xorg-x11-server-Xwayland-23.2.4-1.fc39.x86_64 kf5-kwayland-5.113.0-2.fc39.x86_64 qt5-qtwayland-5.15.12-2.fc39.i686

jelabarre59 avatar Mar 11 '24 17:03 jelabarre59

@jelabarre59 it looks like maybe your /tmp/ permissions are messed up?? Guestfish can't access its tmp file/directory

Crilum avatar Mar 12 '24 14:03 Crilum

Further update, managed to get Ventura working with the following;

podman run -it \
    --device /dev/kvm --device /dev/snd \
    -p 50922:10022 \
    -v $XDG_RUNTIME_DIR/$WAYLAND_DISPLAY:/tmp/$WAYLAND_DISPLAY \
    -e WAYLAND_DISPLAY="${WAYLAND_DISPLAY:-wayland-0}" -e DISPLAY=":1" \
    -e GENERATE_UNIQUE=true -e QT_QPA_PLATFORM=wayland \
    -e XDG_RUNTIME_DIR=/tmp -e GDK_BACKEND=wayland \
    -e CLUTTER_BACKEND=wayland \
    -e RAM=5 \
    -e CPU_STRING=6 \
    -e MASTER_PLIST_URL='https://raw.githubusercontent.com/sickcodes/osx-serial-generator/master/config-custom.plist' \
    --security-opt label=type:container_runtime_t \
    sickcodes/docker-osx:ventura

This is great for potential wayland/X issues, do you to add a note to the README?

sickcodes avatar Apr 08 '24 13:04 sickcodes

Further update, managed to get Ventura working with the following;

podman run -it \
    --device /dev/kvm --device /dev/snd \
    -p 50922:10022 \
    -v $XDG_RUNTIME_DIR/$WAYLAND_DISPLAY:/tmp/$WAYLAND_DISPLAY \
    -e WAYLAND_DISPLAY="${WAYLAND_DISPLAY:-wayland-0}" -e DISPLAY=":1" \
    -e GENERATE_UNIQUE=true -e QT_QPA_PLATFORM=wayland \
    -e XDG_RUNTIME_DIR=/tmp -e GDK_BACKEND=wayland \
    -e CLUTTER_BACKEND=wayland \
    -e RAM=5 \
    -e CPU_STRING=6 \
    -e MASTER_PLIST_URL='https://raw.githubusercontent.com/sickcodes/osx-serial-generator/master/config-custom.plist' \
    --security-opt label=type:container_runtime_t \
    sickcodes/docker-osx:ventura

This is great for potential wayland/X issues, do you to add a note to the README?

Apologies I've never used github to contribute other than comments! I wouldn't have a clue on how to contribute to the README.

alexjfinch avatar Apr 08 '24 17:04 alexjfinch

@jelabarre59 it looks like maybe your /tmp/ permissions are messed up?? Guestfish can't access its tmp file/directory

It's the same as any of my other Fedora systems:

~/src/Docker-OSX$ ls -ld /tmp
drwxrwxrwt. 25 root root 600 Apr  8 20:17 /tmp

jelabarre59 avatar Apr 09 '24 00:04 jelabarre59

@jelabarre59 it looks like maybe your /tmp/ permissions are messed up?? Guestfish can't access its tmp file/directory

It's the same as any of my other Fedora systems:

~/src/Docker-OSX$ ls -ld /tmp
drwxrwxrwt. 25 root root 600 Apr  8 20:17 /tmp

What spin of Fedora are you using? I'll spin up a VM and see if I can replicate your issue.

alexjfinch avatar Apr 09 '24 06:04 alexjfinch

Fedora 39 Cinnamon

jelabarre59 avatar Apr 09 '24 12:04 jelabarre59

Fedora 39 Cinnamon

Ok, I think I've managed to get something working for you. You don't need the wayland libraries and, as you state, the Cinnamon spin is still on X11.

You'll need to install a couple of packages;

sudo dnf install xev xprop -y

Once they're installed run, this has be done every time - it doesn't appear to be persistent

xhost +

I've had varying success, but you shouldn't need to disable SELinux, however if you do;

sudo setenforce 0

make sure libvirt and qemu-kvm are installed;

sudo dnf install libvirt qemu-kvm -y

and that you're added to those user groups;

sudo usermod -aG libvirt "${USER}" sudo usermod -aG kvm "${USER}"

That's pretty much all I had to do from a completely fresh install of Fedora cinnamon with the following container;

podman run -it --device /dev/kvm --device /dev/snd -p 50922:10022 -v /tmp/.X11-unix:/tmp/.X11-unix -e "DISPLAY=${DISPLAY:-:0.0}" -e GENERATE_UNIQUE=true -e MASTER_PLIST_URL='https://raw.githubusercontent.com/sickcodes/osx-serial-generator/master/config-custom.plist' --security-opt label=type:container_runtime_t sickcodes/docker-osx:sonoma

alexjfinch avatar Apr 10 '24 07:04 alexjfinch