cage icon indicating copy to clipboard operation
cage copied to clipboard

Failed to enable unit: Cannot alias [email protected] as display-manager.service

Open TheGreenAirplane opened this issue 11 months ago • 6 comments

Hello, I am trying to set up a kiosk machine using Cage. I'm running Debian 12 (Bookworm). I have installed cage via apt, and I've followed the instructions here https://github.com/cage-kiosk/cage/wiki/Starting-Cage-on-boot-with-systemd to the t. All I've changed was the username, and the app to be executed, which in my case looks like this:

ExecStart=/usr/bin/cage firefox http://localhost:5000 --kiosk

When I got to the third step, I typed in sudo systemctl enable [email protected]

and got back the following message (in bold maroon): Failed to enable unit: Cannot alias [email protected] as display-manager.service.

Can you please help? I'm very new to Linux, I have no idea what I'm doing wrong.

TheGreenAirplane avatar Mar 12 '24 21:03 TheGreenAirplane

You may remove the Alias= line in unit file if it causes error in your case.

joggee-fr avatar Mar 13 '24 09:03 joggee-fr

Thanks. That seems to have helped. I am now able to enable the service. When I reboot, I do indeed get the cage with just Firefox. Although I'm not entirely sure that's what helped.

I've used systemctl to look at the cage unit, this is what I got: image

Thing is, I never manually enabled the one running on tty7. I have probably enabled the one on "tty" and "ty1", through typo's as I was flailing around like a fish out of water. (how can I get rid of them?)

So how did the one at tty7 get started? And why didn't it work from the beginning? I know that's the one doing the magic, because when I disable it through ssh and then restart the machine, I get the normal desktop, and when I enable it again and reboot I get the kiosk.

I also changed the path to my application from firefox to /usr/bin/firefox. Maybe that made it run correctly and made the kiosk appear?

One more thing, when I boot in the kiosk mode, at certain point the original display manager (login screen) appears for about a second or 2. Is it possible to get rid of this, so the user doesn't see it during reboot? The display manager is called kdm3.

TheGreenAirplane avatar Mar 13 '24 14:03 TheGreenAirplane

The systemd unit file proposed in the wiki has DefaultInstance=tty7, it may explain the service you observe. Just disable the service running the kdm3 display manager if you don't want it.

joggee-fr avatar Mar 13 '24 16:03 joggee-fr

You may remove the Alias= line in unit file if it causes error in your case.

This worked for me. Thanks!

J-Cake avatar Apr 14 '24 11:04 J-Cake

@TheGreenAirplane, please consider mark this issue as complete if everything is OK for you now.

joggee-fr avatar Apr 15 '24 13:04 joggee-fr

Hello, I am trying to set up a kiosk machine using Cage. I'm running Debian 12 (Bookworm). I have installed cage via apt, and I've followed the instructions here https://github.com/cage-kiosk/cage/wiki/Starting-Cage-on-boot-with-systemd to the t. All I've changed was the username, and the app to be executed, which in my case looks like this:

ExecStart=/usr/bin/cage firefox http://localhost:5000 --kiosk

When I got to the third step, I typed in sudo systemctl enable [email protected]

and got back the following message (in bold maroon): Failed to enable unit: Cannot alias [email protected] as display-manager.service.

Can you please help? I'm very new to Linux, I have no idea what I'm doing wrong.

The service is failing because your argument is being passed to cage, you would need something like: ExecStart=/usr/bin/cage firefox http://localhost:5000 -- --kiosk

Terramoto avatar May 04 '24 01:05 Terramoto

Running into a similar issue, got this error, removed alias as suggested, but ever since doing that now after reboot I just get a single _ on the monitor and no display. File is exactly as shown (running chromium instead of kde widgets) followed the guide as shown. created the cage user with useradd cage -m also tried re-setting up with the sudoer user I was using to configure the machine, still no luck.

EDIT: Nevermind, figured it out -- program I was starting needed xwayland to work. I would recommend adding a section to the setup guide to test the execution line in the terminal before creating the systemd unit, as this would expose errors in the command you're trying to run. I am running into another issue, after enabling the systemd unit you are no longer able to switch to another terminal using ctrl+alt+(1-7) is there a way to re-enable this feature, as I used it for maintenance of the signage in my previous setup.

Swizzler121 avatar Sep 05 '24 20:09 Swizzler121

@Swizzler121 I've had far less issues on Arch than Debian-based distros. Perhaps that's some low-hanging fruit to try if you're really stuck.

J-Cake avatar Sep 06 '24 10:09 J-Cake