There have been multiple accounts created with the sole purpose of posting advertisement posts or replies containing unsolicited advertising.

Accounts which solely post advertisements, or persistently post them may be terminated.

This profile is from a federated server and may be incomplete. Browse more on the original instance.

Looking to make the switch

Hi everyone, looking to make the switch from windows. I’m reasonably technically apt but not a programmer by any means. I’ve been doing some homework on which distro I would like to use and pop_os kinda feels like the right direction. I’m running an Nvidia 3060TI on a Ryzen 5600 chip set on an Asus tuf motherboard. Any...

vole ,
@vole@lemmy.world avatar

POP!_OS apparently uses systemd-boot (not to be confused with systemd). It apparently adds a Windows entry automatically if Windows is installed on the same disk. When Windows is installed on a different disk, it looks like booting the windows boot manager EFI program is still possible with systemd-boot. The instructions given in that link are a bit vague, though.

This page has a different, simpler approach and more specific steps. Apparently you can just copy the Microsoft EFI folder to a specific directory in your Linux drive’s ESP partition. I’d be a little bit concerned about Windows not being able to update its EFI bootloader, but I also don’t know if Windows ever updates that. The page also has instructions on how to interact with the systemd-boot menu during boot.

You could also install grub yourself, but I can’t guarantee that’ll be easy. Mashing F2 might be the sanest solution, unless you plan on booting into Windows every day.

vole ,
@vole@lemmy.world avatar

This is a text post, so the OP wrote text corresponding to the title. You should be able to see it at the top of the post. (Spoiler, OP is basically asking the community why NixOS is better, because they don’t quite understand the advantages of using NixOS.)

vole , (edited )
@vole@lemmy.world avatar

I got interested, so I spent some time looking into what’s going on here. I’m not intimately familiar with X11 or Wayland, but I figured out some stuff.

Why sudo ip netns exec protected sudo -u user -i doesn’t work for X11 apps

Short answer: file permissions and abstract unix sockets (which I didn’t know were a thing before now).

File permissions: when I start an X11 login session, the DISPLAY is :0 and /tmp/.X11-unix/ has only 1 file X0. This file has 777 access. When I start my wayland session with Xwayland, the DISPLAY is :1 and /tmp/.X11-unix/ has 2 files X0 (777) and X1 (755). I can’t figure out how to connect to display :0, so I guess I’m stuck with :1. When you change to a different (non-root) user, the user no longer has access to /tmp/.X11-unix/X1.

Abstract unix sockets: When I start my wayland/xwayland session, it creates abstract unix sockets with ids @/tmp/.X11-unix/X0 and @/tmp/.X11-unix/X1. See ss -lnp | grep Xwayland. The network namespace also sandboxes these abstract unix sockets. Compare socat ABSTRACT-CONNECT:/tmp/.X11-unix/X1 STDIN and sudo ip netns exec private socat ABSTRACT-CONNECT:/tmp/.X11-unix/X1 STDIN.

When you do sudo ip netns exec protected su - user, you loose access to both the filesystem unix socket /tmp/.X11-unix/X1 and the abstract unix socket @/tmp/.X11-unix/X1. You need access to one or the other for X11 applications to work.

I tried using socat to forward X1 such that it works in the network namespace… and it kinda works. sudo ip netns exec protected socat ABSTRACT-LISTEN:/tmp/.X11-unix/X1,fork UNIX-CONNECT:/tmp/.X11-unix/X1. It appears having ABSTRACT-LISTEN before UNIX-CONNECT is important, I guess it would be worth it to properly learn socat. With this sudo ip netns exec protected su - testuser -c ‘env DISPLAY=:1 xmessage hi’ works, but sudo ip netns exec protected su - testuser -c ‘env DISPLAY=:1 QT_QPA_PLATFORM=xcb kcalc’ does not work. 😞

Changing the file permissions on /tmp/.X11-unix/X1 to give the user access seems to work better.

Wayland waypipe

Waypipe works as advertised. But it’s still a little bit tricky because you need to have two separate processes for the waypipe client and server, wait for the waypipe socket to be created, adjust file permissions for the waypipe socket file, and set (and probably mkdir) XDG_RUNTIME_DIR.


<span style="color:#323232;">waypipe -s /tmp/mywaypipe client &amp;
</span><span style="color:#323232;">sleep 0.1
</span><span style="color:#323232;">chgrp shared-display /tmp/mywaypipe
</span><span style="color:#323232;">chmod g+w /tmp/mywaypipe
</span><span style="color:#323232;">sudo ip netns exec protected su - testuser -c 'mkdir -p -m 0700 /tmp/runtime-testuser &amp;&amp; env XDG_RUNTIME_DIR=/tmp/runtime-testuser waypipe -s /tmp/mywaypipe server -- env QT_QPA_PLATFORM=wayland kcalc'
</span><span style="color:#323232;">kill -SIGINT %1
</span>

Combined

into this script github.com/…/run-netns-user-wayland.bash

vole ,
@vole@lemmy.world avatar

/home is not deprecated, it’s optional but common. Here is the section from FHS: refspecs.linuxfoundation.org/…/ch03s08.html

  • All
  • Subscribed
  • Moderated
  • Favorites
  • random
  • lifeLocal
  • goranko
  • All magazines