I have an old laptop set up with mint (what I had a usb laying around for) and running foundryvtt with docker. That’s all set up and working great, starts services on reboot, runs headless.
What I would like to do, mainly because I think it would look cool, is have a small CRT screen that I have plugged into the laptop via HDMI to display the performance status with htop, or docker output or something. I can do this with starting a terminal session with the other display plugged in, but this requires user interaction and all of that.
This side of linux is kind of new to me, so I am not sure what direction I need to start looking in. Is it possible to set up a service to run headless and output to a display in a way that automatically comes up if the device is rebooted? Or is it possible to modify my existing docker container to output logs to display?
Appreciate any input to help get me pointed in the right direction.
EDIT: Solved!
Thanks to everyone for pointing me towards getty, grub boot settings, and bash profiles - got a setup that I’m happy with.
I was able to disable the laptop monitor and enable the CRT by adding this to /etc/default/grub
# Disable laptop monitor (LVDS-1) and only output to CRT (HDMI-A-1)
GRUB_CMDLINE_LINUX_DEFAULT="video=LVDS-1:d video=HDMI-A-1:1024x768"
(don’t forget sudo update-grub to apply)
I initially set it to 640x480, but display was better with higher res and large font size, which I scales up with sudo dpkg-reconfigure console-setup
I created a service account for this, and set up a systemd service to start getty on that account based on those docs
[Service]
Type=idle
ExecStart=
ExecStart=-/sbin/agetty --skip-login --noreset --noclear --autologin axies - ${TERM}
Then I added htop to the ~/.bash_profile for that user and… done!
Only thing is there is some overscan on the display and initially about 3 rows / cols were cut off on each side. I was able to adjust the CRT display itself to mostly mitigate this, so now only a bit is cut off and it’s usable, but it’s not perfect. I tried setting the margin in the video options in grub with margin_top, margin_left etc., as per these docs but that didn’t work, even though I verified the resolution was applying correctly. But it is functional!

I found this: https://wiki.archlinux.org/title/Getty
That’s for Arch, but it’s pretty standard, unless Ubuntu/Mint have deviated from tradition. Getty is what manages the TTYs. I assume running under X or Wayland is not what you’re looking for.
That definitely looks like it is in the direction I want to go. I’ll read those docs. I do have getty on mint so I’ll do some testing
I don’t know what headless means but that might just be a me problem.
So your server now has a monitor and you don’t always want to connect to it? It seems like a big waste of power.
Anyway, you could probably start an xserver in the background and output to the xserver outputting to the CRT. Then instruct your terminal to launch on that display. Just make sure you right an xorg.conf file configured to the right display.
There’s probably a more modern way to do this in Wayland but I’m not familiar.
What OS?
From what I know, headless means different things depending on context - in this instance I’m using it in the sense that my server does not require any user session, or any user input devices, it just powers on and all of the services start up at the system level. I can SSH into it to configure things, but it doesn’t require any user session or input to run the services. A video output probably falls outside of this in some sense, but I would like it to be automatic without requiring an active user session.
The monitor I have is an old Panasonic tv / radio combo, so the display can be flipped on with a physical switch when I’m at my desk, so shouldn’t be any wasted power usage. It won’t be on all the time.
I’m using Linux Mint, which is probably not optimal, but I had a USB ready and I’m just using terminal stuff so it didn’t seem like it mattered too much. It does have systemd, which made it pretty easy to set up the docker stuff
Thanks for the input!
You should be able to set up the system to autologin on startup and then run commands from the auto-logged-in user’s .bash_profile, if you can reduce what you want to do to a script. You’d probably want to specially set up a user for this, to reduce security risks.
(I just stood up a weird little Gentoo media PC that does approximately this—logs a user in on startup and then runs
startxfrom .bash_profile to make it easier to use with no keyboard attached and no DM. You’d just want to put a different command in instead.)I was trying to start the monitoring program as part of the systemd service. Idk why I didn’t think to use the bash profile on a service account. That should work perfect! Thanks
deleted by creator

