{"id":2151,"date":"2025-11-18T23:49:20","date_gmt":"2025-11-18T22:49:20","guid":{"rendered":"https:\/\/www.hutsky.cz\/blog\/?p=2151"},"modified":"2025-11-18T23:58:13","modified_gmt":"2025-11-18T22:58:13","slug":"turn-off-screen-on-a-headless-machine","status":"publish","type":"post","link":"https:\/\/www.hutsky.cz\/blog\/2025\/11\/turn-off-screen-on-a-headless-machine\/","title":{"rendered":"Turn off screen on a headless machine"},"content":{"rendered":"\n<p>While playing with my homelab Forgejo instance, I needed a place where actions could be run. I was considering a virtual machine on my NAS but in the end, I dug up an old laptop that I haven&#8217;t been using for anything for quite a while, mostly because it&#8217;s a bit heavy (16&#8243;), the battery is half-dead and the TN screen is not great. But even though it&#8217;s a bit older, like ten years, it&#8217;s still a fairly decent machine with eight cores and 16 GB of RAM &#8211; more than enough to serve as an occasional headless forgejo action runner. I only wake it up with <dfn><abbr title=\"Wake on LAN\">WOL<\/abbr><\/dfn> only when it&#8217;s needed, it doesn&#8217;t have to run 24\/7.<\/p>\n\n\n\n<p>There was no desktop environment needed so it was a headless machine that went to a terminal after boot. I wanted to blank the screen after the boot but it wouldn&#8217;t happen on its own. At first, I tried turning it down by running setterm in a script one minute after the boot but it didn&#8217;t work:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>#!\/bin\/bash\nsleep 60\nsetterm --powerdown=1 &lt; \/dev\/tty1<\/code><\/pre>\n\n\n\n<p>What did work though was updating the grub config so that it contains this line:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># cat \/etc\/default\/grub\n...\nGRUB_CMDLINE_LINUX=\"consoleblank=60\"\n...<\/code><\/pre>\n\n\n\n<p>After that, the screen would blank one minute after the boot.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>While playing with my homelab Forgejo instance, I needed a place where actions could be run. I was considering a virtual machine on my NAS but in the end, I dug up an old laptop that I haven&#8217;t been using &hellip;<\/p>\n<p class=\"read-more\"> <a class=\"more-link\" href=\"https:\/\/www.hutsky.cz\/blog\/2025\/11\/turn-off-screen-on-a-headless-machine\/\"> <span class=\"screen-reader-text\">Turn off screen on a headless machine<\/span> Read More &raquo;<\/a><\/p>\n","protected":false},"author":4,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[52,8],"tags":[48,18],"class_list":["post-2151","post","type-post","status-publish","format-standard","hentry","category-hardware","category-operatingsystems","tag-hardware","tag-linux"],"_links":{"self":[{"href":"https:\/\/www.hutsky.cz\/blog\/wp-json\/wp\/v2\/posts\/2151","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.hutsky.cz\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.hutsky.cz\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.hutsky.cz\/blog\/wp-json\/wp\/v2\/users\/4"}],"replies":[{"embeddable":true,"href":"https:\/\/www.hutsky.cz\/blog\/wp-json\/wp\/v2\/comments?post=2151"}],"version-history":[{"count":5,"href":"https:\/\/www.hutsky.cz\/blog\/wp-json\/wp\/v2\/posts\/2151\/revisions"}],"predecessor-version":[{"id":2162,"href":"https:\/\/www.hutsky.cz\/blog\/wp-json\/wp\/v2\/posts\/2151\/revisions\/2162"}],"wp:attachment":[{"href":"https:\/\/www.hutsky.cz\/blog\/wp-json\/wp\/v2\/media?parent=2151"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.hutsky.cz\/blog\/wp-json\/wp\/v2\/categories?post=2151"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.hutsky.cz\/blog\/wp-json\/wp\/v2\/tags?post=2151"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}