I don’t have spare peripherals like a monitor and a keyboard. How do you suggest I do a bare-metal install of Debian on a computer (meant to be a server)?

You’ll waste more time trying to figure out how to do this than it would take to move a monitor and keyboard to the server, do the install, and plug the monitor and keyboard back into your main computer. Once the server is up, you can administer it over the network via ssh.

permalink
report
reply
27 points

Definitely agree for a single install. If OP has a bunch of these installs to do, then editing an install USB to configure networking and enable sshd might be worth the effort. Do the install over ssh and hope the machine starts up as desired, but even then, if it doesn’t just magically appear on the network, he’s going to need a monitor to see where the startup failed.

Raspberry Pi’s disk imager will let you pre-configure networking, accounts, and ssh, so you just write the image to an SD card, plug it in, and go. That’s a great solutions for systems usually meant to be headless and removable media. If OP’s client hardware allows, he could plug in the M2 or SATA drive meant to be the server’s startup, install Deb there, and. transfer to the server hardware. That’s definitely more work that just swapping the keyboard & monitor, but it accomplishes OP’s stated goal. (Otherwise, a lot of this thread follows the linux meme of “How do I [X]?” “[X] is dumb, do [Y] instead.”)

permalink
report
parent
reply

Agreed on all counts.

My reply initially had a “if you had a fleet of these things…” addendum, but OP’s post read (to me) as though he was converting commodity hardware into a makeshift home server, so I removed it because it was almost certainly not relevant.

permalink
report
parent
reply
1 point

True, it’s just that I’d like to avoid purchasing more useless stuff. I might move in a few months and maybe carry these computers but I definitely won’t be able to take my monitor. Just going to be a waste of money, and I’m trying to be frugal.

I am planning to build a small cheap DIY KVM using PiKVM and cheap Aliexpress parts (Raxda’s Zero 3W or the Banana Pi Zero, not sure if they are supported though) in about $25 which I can probably carry around

permalink
report
parent
reply
68 points

Also, the word you’re looking for is: “headless”, as in, “headless install”

permalink
report
reply
25 points

Plug drive in main computer, install Debian on it along with network config and SSH access, put drive back into server and power on.

I guess technically you can also make an ISO that will just auto wipe the drive and install upon booting it but you still need a keyboard to get into the boot menu.

permalink
report
reply
1 point

Yes that’s an option I’m looking at. Thanks

permalink
report
parent
reply
23 points

While I agree with most people here that finding a keyboard and screen would be the easiest option, you do have a couple of other options:

  • Use a preseed file A preseed lets the installer run completely automatically, without user intervention. Get it to install a basic system with SSH and take it from there. You’ll want to test the install in a VM, where you can see what’s going on before letting it run on the real server. More information here: https://wiki.debian.org/DebianInstaller/Preseed

  • Boot from a live image with SSH Take a look at https://wiki.debian.org/LiveCD in particular ‘Debian Live’. It looks like ssh is included, but you’d want to check the service comes up on boot. You can then SSH to the machine and install to the harddrive that way. Again, test on a VM until you know you have the image working, and know how to run the install, then write it to a USB key and boot the tsrget server from that.

This all assumes the target server has USB or CD at the top of its boot order. If it doesn’t you’ll have to change that first, either with a keyboard and screen, or via a remote management interface sych as IPMI.

permalink
report
reply
2 points

Once upon a time you could use a thing called debootstrap to install Debian on the hard disk in a chroot on another machine, then switch the hdd to the target machine. Not sure if that thing is still around.

permalink
report
parent
reply
1 point

You could just use the installer

permalink
report
parent
reply
1 point

Yes, that’ll work too, it does involve adding the disk to your machine temporarily though, so just be carefully which disk you format to do it. Please don’t ask why I say that, it brings back painful memories…

permalink
report
parent
reply
1 point

I did look at Preseed and it’s probably a good idea if I’m doing many installs at once. I will still look at it but I’ll likely have to purchase a monitor anyway. It is unfortunate because I don’t have any thrift stores nearby

permalink
report
parent
reply
1 point

It’s going to be a balance between your time getting an automated approach to work and the cost/effort of getting a monitor. Getting preseed working can be a bit fiddly, but it does mean you’ve learnt a new skill, getting a monitor sounds like it’ll be a pain, and you might only need it once.

permalink
report
parent
reply
1 point

Exactly. It’s junk after that

permalink
report
parent
reply
21 points

When i was doing a headless install, i spend a hour or two trying to figure out how to pre setup configs for the debian installer or how to do it over network or what before i finally lugged the new machine to the other room and plugged it into the monitor and keyboard of the main rig, installed it all (and set up ssh so i can later get into from the main rig), and unplugged it.

My point is, even if it isnt trivial to have the keyboard and monitor, it may be much easier to get them than to really do an install without them.

permalink
report
reply
1 point

I guess so. It’s just going to be junk that I can’t take with me when I move though

permalink
report
parent
reply

Selfhosted

!selfhosted@lemmy.world

Create post

A place to share alternatives to popular online services that can be self-hosted without giving up privacy or locking you into a service you don’t control.

Rules:

  1. Be civil: we’re here to support and learn from one another. Insults won’t be tolerated. Flame wars are frowned upon.

  2. No spam posting.

  3. Posts have to be centered around self-hosting. There are other communities for discussing hardware or home computing. If it’s not obvious why your post topic revolves around selfhosting, please include details to make it clear.

  4. Don’t duplicate the full text of your blog or github here. Just post the link for folks to click.

  5. Submission headline should match the article title (don’t cherry-pick information from the title to fit your agenda).

  6. No trolling.

Resources:

Any issues on the community? Report it using the report flag.

Questions? DM the mods!

Community stats

  • 5.2K

    Monthly active users

  • 3.7K

    Posts

  • 81K

    Comments