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

Switching to Wayland

Open iMonZ opened this issue 4 years ago • 10 comments

Is it possible to support wayland? Since X11 is nearly dead maybe it has a year or so until the final grave. And xwayland isn’t a very good experience so a native Wayland solution would be insane!

thanks!

iMonZ avatar Dec 14 '21 17:12 iMonZ

Good idea I just tried it and it's smooth as butter!

Thank you for bringing this up!!

Terminal 1: wayfire

Terminal 2:

change DISPLAY to :1
    -e "DISPLAY=:1" \

https://user-images.githubusercontent.com/65906298/146274213-2195f541-cf10-4c7e-b4aa-5ffd54baf337.mp4

https://user-images.githubusercontent.com/65906298/146272994-106c1425-9cc9-4858-913d-098df227fd0a.mp4

sickcodes avatar Dec 15 '21 22:12 sickcodes

Great thanks! But you need WAYLAND_DISPLAY instead of DISPLAY.

iMonZ avatar Jan 03 '22 22:01 iMonZ

Could you add Wayland to the readme tutorial? This would be really nice!

iMonZ avatar Jan 03 '22 23:01 iMonZ

Hey, I use Fedora 35 which defaults to wayland and Im having issues with GTK initialization that I suspect could come from using WAYLAND, as otherwise I've followed the steps. Could you share the command you use to start it with wayland? I tried to change DISPLAY for WAYLAND_DISPLAY without luck. I can make it work through VNC for now tough. Thanks!

Julioevm avatar Mar 10 '22 09:03 Julioevm

these variables may help:

-e XDG_RUNTIME_DIR=/run/user/1000
-e XDG_SESSION_TYPE=wayland
-e WAYLAND_DISPLAY=wayland-1

or

-e WAYLAND_DISPLAY=wayland-1

for testing purposes only, can you set /run/user/1000 to chmod 777, and then when you're finished change it back to 700.

If that works, Ill add the chown to the Dockerfile and support wayland naturally :)

sickcodes avatar Mar 11 '22 03:03 sickcodes

I can confirm this did the trick for me! 🥳

boredland avatar May 22 '22 16:05 boredland

these variables may help:

-e XDG_RUNTIME_DIR=/run/user/1000
-e XDG_SESSION_TYPE=wayland
-e WAYLAND_DISPLAY=wayland-1

or

-e WAYLAND_DISPLAY=wayland-1

for testing purposes only, can you set /run/user/1000 to chmod 777, and then when you're finished change it back to 700.

If that works, Ill add the chown to the Dockerfile and support wayland naturally :)

So this two lines can be removed:
-v /tmp/.X11-unix:/tmp/.X11-unix
-e "DISPLAY=${DISPLAY:-:0.0}" \

?

iMonZ avatar May 22 '22 16:05 iMonZ

for testing purposes only, can you set /run/user/1000 to chmod 777

@sickcodes i think that this helped for me, but there a couple confounding factors i'm trying to suss out.

  1. Fedora 36 wayland
  2. user with uid 501 instead of 1000

this comment was mega helpful: https://github.com/sickcodes/Docker-OSX/issues/419#issuecomment-1011401905 most important was to properly mount my /run/user folder $XDG_RUNTIME_DIR/$WAYLAND_DISPLAY:/tmp/$WAYLAND_DISPLAY

then for permissions i needed to:

sudo chmod 777 $XDG_RUNTIME_DIR/wayland-*
# which in my case is:
# sudo chmod 777 /run/user/501/wayland-*

i use docker-compose (nearly religiously) so here is my yml

osx:
    privileged: true
    devices: 
      - /dev/kvm
      - /dev/snd
    ports:
      - 50922:10022
    volumes:
      # - /tmp/.X11-unix:/tmp/.X11-unix
      - $XDG_RUNTIME_DIR/$WAYLAND_DISPLAY:/tmp/$WAYLAND_DISPLAY
    environment:
      # GENERATE_UNIQUE: true
      RAM: 8
      XDG_RUNTIME_DIR: /tmp
      WAYLAND_DISPLAY: "${WAYLAND_DISPLAY:-wayland-0}"
      QT_QPA_PLATFORM: wayland
      GDK_BACKEND: wayland
      CLUTTER_BACKEND: wayland
      DISPLAY: ":1"  # "${DISPLAY:-:0}"
      XDG_SESSION_TYPE: wayland
      # EXTRA: "-display none" 

    image: sickcodes/docker-osx:big-sur

install is underway! image

gotjoshua avatar Oct 09 '22 10:10 gotjoshua

for testing purposes only, can you set /run/user/1000 to chmod 777

@sickcodes i think that this helped for me, but there a couple confounding factors i'm trying to suss out.

1. Fedora 36 wayland

2. user with uid 501 instead of 1000

this comment was mega helpful: #419 (comment) most important was to properly mount my /run/user folder $XDG_RUNTIME_DIR/$WAYLAND_DISPLAY:/tmp/$WAYLAND_DISPLAY

then for permissions i needed to:

sudo chmod 777 $XDG_RUNTIME_DIR/wayland-*
# which in my case is:
# sudo chmod 777 /run/user/501/wayland-*

i use docker-compose (nearly religiously) so here is my yml

osx:
    privileged: true
    devices: 
      - /dev/kvm
      - /dev/snd
    ports:
      - 50922:10022
    volumes:
      # - /tmp/.X11-unix:/tmp/.X11-unix
      - $XDG_RUNTIME_DIR/$WAYLAND_DISPLAY:/tmp/$WAYLAND_DISPLAY
    environment:
      # GENERATE_UNIQUE: true
      RAM: 8
      XDG_RUNTIME_DIR: /tmp
      WAYLAND_DISPLAY: "${WAYLAND_DISPLAY:-wayland-0}"
      QT_QPA_PLATFORM: wayland
      GDK_BACKEND: wayland
      CLUTTER_BACKEND: wayland
      DISPLAY: ":1"  # "${DISPLAY:-:0}"
      XDG_SESSION_TYPE: wayland
      # EXTRA: "-display none" 

    image: sickcodes/docker-osx:big-sur

install is underway! image

I used your docker-compose file and turns out the crucial part was running:

chmod 777 $XDG_RUNTIME_DIR/wayland-*

I can rule out a few factors:

  1. I'm running Arch Linux (Wayland/Sway) and with UID 1000.
  2. Didn't need to run chmod 700 /run/user/1000 # $XDG_RUNTIME_DIR.

I tested with Mac OS Ventura by adding these two environment variables as mentioned in the readme:

   ...
    -e GENERATE_UNIQUE=true \
    -e MASTER_PLIST_URL='https://raw.githubusercontent.com/sickcodes/osx-serial-generator/master/config-custom.plist' \

mroyme avatar Nov 30 '22 16:11 mroyme