[Solved] Creating a headless/monitorless install/live usb image with sshd enabled
[Solved] Creating a headless/monitorless install/live usb image with sshd enabled
I have a machine without any VGA card with it, so I cannot install anything on it that relies on monitor feedback.
I want to create a Debian USB image that I can use to boot the machine and I can ssh into it to install the system through there. I don't want to have any automated setup, only an SSH connection I can use to run the installer.
What are my options and how can I achieve it?
I want to create a Debian USB image that I can use to boot the machine and I can ssh into it to install the system through there. I don't want to have any automated setup, only an SSH connection I can use to run the installer.
What are my options and how can I achieve it?
Re: Creating a headless/monitorless install/live usb image with sshd enabled
Preseed would help, if I wanted to automate the installation, but in fact I don't want to do that. So the question is: how to create a live/setup usb drive that has the openssh-server enabled by default (with a pre-known password or key).arzgi wrote: 2025-01-12 13:07 Search the forum for preseed. Installing Debian without display can be quite hard. You need openssh-server.
-
- Posts: 1779
- Joined: 2008-02-21 17:03
- Location: Finland
- Has thanked: 1 time
- Been thanked: 103 times
Re: Creating a headless/monitorless install/live usb image with sshd enabled
I don't know any other working method, does the server have any display connector, would make the job some gazillion times easier. Just for the installation time, after that you could run it blindly.
You could make your own setup disk, but that is not a newbie task. Searh the net.
You could make your own setup disk, but that is not a newbie task. Searh the net.
-
- Posts: 1779
- Joined: 2008-02-21 17:03
- Location: Finland
- Has thanked: 1 time
- Been thanked: 103 times
Re: Creating a headless/monitorless install/live usb image with sshd enabled
If the server is not a Rasberry Pi, you could take the hd/sd out of the server, connect it your pc, install there the ssh-server and keys. Test it, if it works, connect back to the server, try ssh connection. If does not work, start over.
But there are some caveats, if your net devices differ, then the server might not get online.
But there are some caveats, if your net devices differ, then the server might not get online.
-
- Global Moderator
- Posts: 4276
- Joined: 2014-07-20 18:12
- Location: Europe
- Has thanked: 125 times
- Been thanked: 576 times
Re: Creating a headless/monitorless install/live usb image with sshd enabled
Hello,
These are two different topic:
This topic has been already discussed some time ago in this forum (search the forum) and in Debian mailing list (i.e. [1]).
Hope this helps.
--
[1] Is there a way to ssh into the debian installation process?
What exactly are you looking for?syntern wrote: 2025-01-12 13:16Preseed would help, if I wanted to automate the installation, but in fact I don't want to do that. So the question is: how to create a live/setup usb drive that has the openssh-server enabled by default (with a pre-known password or key).arzgi wrote: 2025-01-12 13:07 Search the forum for preseed. Installing Debian without display can be quite hard. You need openssh-server.
These are two different topic:
- As @arzgi already wrote, if you need a Debian Installer that can be reached via ssh, you will need to modify the Debian Installer ISO to use preseed to let the installer configure language, region, network adapter, connection (otherwise you cannot connect to the network) and install/start the network-console and openssh-server-udeb installer udeb packages.
- If you need a Debian Live that can be reached via ssh after booting, you will need to modify the Debian Live of your choice to allow the ssh server to be started.
This topic has been already discussed some time ago in this forum (search the forum) and in Debian mailing list (i.e. [1]).
Hope this helps.
--
[1] Is there a way to ssh into the debian installation process?
Re: Creating a headless/monitorless install/live usb image with sshd enabled
Again, to summarize it:
- I have a machine without any VGA output / not able to attach any monitor, I want Debian on it.
- I cannot automate the install procedure, because I don't know all the things about the devices and their ids upfront.
- I can boot an USB live image or installer, but they don't enable remote ssh by default (some distros enable it - they print the root password to the console, and I cannot see it either).
I thought that it should be easy to take either the live image or an installer image and enable remote ssh into it, but apparently this is not a use-case people care about or made easy to do.
Note: getting the IP is a non-issue, I will get it from my router. The decade-old mail list thread you've linked to may help, but it seems to involve way more custom build on components that I don't have the faintest idea about, and I wouldn't consider it accessible or easy. At that point I'd rather drop the project (return the device) and consider it lame that we cannot do such setups.
-
- Posts: 1779
- Joined: 2008-02-21 17:03
- Location: Finland
- Has thanked: 1 time
- Been thanked: 103 times
Re: Creating a headless/monitorless install/live usb image with sshd enabled
Just out of interest, can you tell what kind your server is? For me it is hard to believe that any would try to sell a comptuter without display connectors.
Re: Creating a headless/monitorless install/live usb image with sshd enabled
It is an Asustor NAS, but other NAS manufacturers have similar devices too.arzgi wrote: 2025-01-12 18:16 Just out of interest, can you tell what kind your server is? For me it is hard to believe that any would try to sell a comptuter without display connectors.
-
- Global Moderator
- Posts: 4276
- Joined: 2014-07-20 18:12
- Location: Europe
- Has thanked: 125 times
- Been thanked: 576 times
Re: Creating a headless/monitorless install/live usb image with sshd enabled
Hello,
The use case exists (I.e. for the Debian Installer) and is documented, but it requires preseeding the installer, as already pointed out; see:syntern wrote: 2025-01-12 17:49 I thought that it should be easy to take either the live image or an installer image and enable remote ssh into it, but apparently this is not a use-case people care about or made easy to do.
Yes, getting the IP is not a problem, knowing what the assigned lease is might be more difficult. :wink:
As you wish! Bye :wink:syntern wrote: 2025-01-12 17:49 At that point I'd rather drop the project (return the device) and consider it lame that we cannot do such setups.
Re: Creating a headless/monitorless install/live usb image with sshd enabled
https://fai-project.org/FAIme/live/ gives me a live image that I can ssh into. Unfortunately debian-installer-launcher does not work as expected, it gives the following errors depending on running without or with the live plugin:
or
Do I need to install further packages? Is there any alternative text-based installer?
Code: Select all
ERROR: 'kexec' is not a valid plugin. Check and try again.
umount: /run/live/installer: no mount point specified.
Code: Select all
no suitable d-i initrd image found, aborting.
umount: /run/live/installer: no mount point specified.
Last edited by syntern on 2025-01-12 23:36, edited 1 time in total.
Re: Creating a headless/monitorless install/live usb image with sshd enabled
The following repository provided an easy to run solution that created the USB image I wanted:
https://github.com/philpagel/debian-headless
https://github.com/philpagel/debian-headless
-
- Posts: 1779
- Joined: 2008-02-21 17:03
- Location: Finland
- Has thanked: 1 time
- Been thanked: 103 times
Re: Creating a headless/monitorless install/live usb image with sshd enabled
Nice! Could you please edit the header of your first post in the thread, and prepend with [SOLVED]. So anyone browsing the forum sees it does need further activities, and if someone has a problem close to what you had, sees a possible solution.
EDIT: Perhaps you overlooked this, but Asustor has this https://www.asustor.com/admv2?type=3&sub=134
EDIT: Perhaps you overlooked this, but Asustor has this https://www.asustor.com/admv2?type=3&sub=134
-
- Global Moderator
- Posts: 4276
- Joined: 2014-07-20 18:12
- Location: Europe
- Has thanked: 125 times
- Been thanked: 576 times
Re: Creating a headless/monitorless install/live usb image with sshd enabled
Hello,
I'm attaching the current version of the git repository you sent to this post for future reference. It's very small.
As advised by @arzgi in the previous post, please, mark the discussion as "solved" manually adding the text tag "[Solved]" at the beginning of the subject of the first message.
I'm glad you sorted it out and thanks for the feedback.syntern wrote: 2025-01-13 10:45 The following repository provided an easy to run solution that created the USB image I wanted:
https://github.com/philpagel/debian-headless
I'm attaching the current version of the git repository you sent to this post for future reference. It's very small.
As advised by @arzgi in the previous post, please, mark the discussion as "solved" manually adding the text tag "[Solved]" at the beginning of the subject of the first message.
- Attachments
-
- debian-headless-2025.01.14.tar.gz
- (84.83 KiB) Downloaded 18 times
Re: Creating a headless/monitorless install/live usb image with sshd enabled
as it is not marked solved (although it is solved) the TO may also have used the Debian Live Project to build his own ISO and e.g. use hooks (minimal scripts) during iso-building to install and activate the ssh-server etc.
https://www.debian.org/devel/debian-live/
https://www.debian.org/devel/debian-live/
-
- Global Moderator
- Posts: 4276
- Joined: 2014-07-20 18:12
- Location: Europe
- Has thanked: 125 times
- Been thanked: 576 times
Re: Creating a headless/monitorless install/live usb image with sshd enabled
Is there any further pointer into those hooks and minimal scripts?mcdaniels wrote: 2025-01-15 10:40 as it is not marked solved (although it is solved) the TO may also have used the Debian Live Project to build his own ISO and e.g. use hooks (minimal scripts) during iso-building to install and activate the ssh-server etc.
https://www.debian.org/devel/debian-live/
Re: Creating a headless/monitorless install/live usb image with sshd enabled
You may open a separate Thread.syntern wrote: 2025-01-18 21:29Is there any further pointer into those hooks and minimal scripts?mcdaniels wrote: 2025-01-15 10:40 as it is not marked solved (although it is solved) the TO may also have used the Debian Live Project to build his own ISO and e.g. use hooks (minimal scripts) during iso-building to install and activate the ssh-server etc.
https://www.debian.org/devel/debian-live/