It was in the evening, there was nothing to do, or how to install Gentoo without a keyboard

A humorous story based on real events.

It was in the evening, there was nothing to do, or how to install Gentoo without a keyboard

It was one boring evening. My wife is not at home, the alcohol is over, the pillbox is not connected. What to do in such a situation? Of course, build Gentoo!!!

So, let's begin!

Given: an old server with 2Gb RAM, AMD Athlon Dual, two 250Gb hard drives, one of them has a system installed and a non-working BIOS battery. Also Sony Bravia TV with VGA input and mouse. As well as a Wi-Fi router and a working laptop with Manjaro Arch Linux and i3 environment.

Required: install Gentoo.

Day 1

21:00 I take out an old dusty server from the closet. From there I take out a box with wires and other junk and an old telly (the closet in the hallway is large, everything fits right there). I rummage through the box, untangle the wires, take out the patch cord, VGA cable, mouse, power cable and a set of screwdrivers (if I need it).

21:15 I start looking at all this and thinking about the question “How can I do this?”. After all, I did not have the most important attribute for installing Gentoo - the keyboard!

21:20 I think, “What if you take the screw out of the server, plug it into a USB carrier and deploy the system on it? Not kosher, you have to assemble the core on the same hardware ... ". While I was thinking about this option, I managed to pull out the screw and put it into the carrier, but when I screwed the last bolt into the box, I decided that this would not work!

21:30 I unscrew the bolts back, put the screw back into place in the server. I think further: “There is only one option left - SSH access. Maybe there is such a LiveUSB with sshd already running?

21:35 I go to Gento official website. I download the "Minimal Installation CD" out of habit. Cancel. Without a keyboard, this is a dead number! Below is a link to "Hybrid ISO (LiveDVD)". Yeah, I think that's where everything is! I rock and deploy to flash drive.

21:50 I carry the server, TV set, wires, mouse from the kitchen, where my thoughts and preparations took place, to the far corner room. The server is noisy like an industrial vacuum cleaner, so the district police officer would definitely come to visit! Plugged everything in and started the car.

22:00 The previous OS is loaded! I turn off the server and start thinking: “The battery is dead, I can’t enter the BIOS (there is no keyboard), but I must, by all means, boot from the USB flash drive!”. I disassemble the server, I disconnect one screw. I'm launching. The previous OS is loaded! I include the screw back, I disconnect another! Works!

22:10 And here is the long-awaited LiveUSB boot selection screen! The time remaining before the automatic selection of the first boot option is running, “Now everything will be fine, you just have to wait a bit,” I rejoice! The cherished 30 seconds pass, the screen goes blank, and nothing happens. “Okay, while it’s loading, I’ll go smoke ...”, I decided to take a break and take a break from this noise.

22:15 I return to the “noise room”. The screen is black and nothing happens! “Strange…”, I thought, “In any case, it would have loaded already!”. By the way, everything is aggravated by the fact that my TV does not always show what is happening on the screen, it does not perceive some modes and refuses to broadcast a picture of what is happening ... I restart the server. I sit, I look ... Again, a black screen, everything is the same. Well, I freaked out, and started poking at the mouse buttons ... And, oh God, it turned on and the download started. Later I discovered that the download only continues after pressing a small button on this wonderful mouse! Without this button, God knows how this evening would have ended!? After all, the goal is set, and we must achieve it by any means!

Mouse photoIt was in the evening, there was nothing to do, or how to install Gentoo without a keyboard

22:20 My ears are ringing, but I keep moving towards my goal! Gentoo is up and running! The colors are pleasing to the eye! The mouse moves across the screen! And at the bottom it says “No password needed for login”, which is just fine, because I don’t have a keyboard! There are two fields on the screen: the choice of the working environment and the password, and the login button. LiveDVD Gentoo offers a fairly wide selection of environments, including Fluxbox, Openbox, xfce, plasma, and so on. The option with the choice of "rat" seemed to me an excellent choice! I go into the working environment of the "rat". Wonderful! There is a terminal, but why do I need it, I don’t have a keyboard!

Login screenIt was in the evening, there was nothing to do, or how to install Gentoo without a keyboardIt was in the evening, there was nothing to do, or how to install Gentoo without a keyboard

22:25 I start looking for some kind of on-screen keyboard or something. Found only "Character Map". “Well, great, here it is my way out!”, I thought. But it was not there! You can poke text, copy, paste, but how to click Enter!? Let me remind you that the task is to start sshd, which comes down to typing in the terminal "sudo /etc/init.d/sshd start", and pressing the button Enterwhich I don't have! What to do? But there is a way out!

22:30 Rest time from the noise. I go to the kitchen and sit down at my laptop. Any terminals, if you paste the copied text with a newline into them, will execute the command, because treat newlines as Enter. So, the solution is found! You need to upload an HTML page with a command and a line feed to the Internet. It is HTML, because, as a simple text file, the browser will open in one line "gobble" all the transitions to a new line. So my page looks like this:

<html>sudo /etc/init.d/sshd start<br/>1</html>

"1" is needed so that you can copy the transition to a new line, otherwise only one line is copied, do not set how many "". I upload the file to a certain site using the link "mydomain.ru/1.htm».

22:40 I return to the "noise room". The main thing is to have time to return before turning on the screensaver, which, when you exit it, says that it is an old version and will not let you back into the system with an empty password! I open the browser and the symbol table with anticipation of success! I'm typing "mydomain". Looking for a point...

22:50 Found a point! It is necessary to select the view mode "By Unicode Block". I dial the address further, the benefit of "/" and the numbers were found along with the dot! I copy the text, paste it into the address bar, click go. The time in the system is set as “01.01.2002/XNUMX/XNUMX” due to a dead BIOS battery, and under such conditions SSL certificates do not work!

symbol tableIt was in the evening, there was nothing to do, or how to install Gentoo without a keyboardIt was in the evening, there was nothing to do, or how to install Gentoo without a keyboard

23:00 I'm in the kitchen, taking a break from the noise. The main thing is not to rest for a long time, otherwise the screensaver will turn on! Setting up NGINX to serve my non-HTTPS file at "mydomain.ru/2.htm”, because the old address was redirected and cached by the browser.

23:05 A little rested from the noise and with anticipation of success, I fill the link again, because the button "Backspace» do not emulate! Well, this is for a laugh, but in fact, I just press “2” in the character table, select, copy and replace in the address bar. "Jump"! “Well, really!”, I thought. With a sense of pride, I copy two lines from the page and put them in the terminal. The SSH server is running, it's time to try connecting by looking at the IP address in the web management interface on the Wi-Fi router! Actually, no, it's still early! Too bad I didn't get it right away...

23:15 I return to the "mouse", adding before that the line

sudo passwd<br/>123<br/>1

and updating the html file on the server. Fortunately, you don't need to enter anything else! I update the page. Well, according to the old scheme, I copy the lines to the terminal to run "sudo passwd» and separately twice for entering and repeating the password.

23:17 Connected! Now I'm not afraid of the screensaver and the noise!

01:00 The process that I went through from the moment the ssh connection was established until now is described in detail in many sources, the most complete is presented in Gentoo Handbook. I compiled the kernel, installed grub and the assembled kernel into it. Set up networking and SSH on the new system. Ready, "reboot»!

Day 2 - day off

10:00 Returned to his task. Turned on the server. Nothing happens on the screen, there is no server in the network! Thought it was a network problem. After booting from LiveDVD, I set up the network, but it didn't help...

When starting the server, on my old TVIt was in the evening, there was nothing to do, or how to install Gentoo without a keyboard

10:30 I decided that it would be nice to study the download logs. There are no logs! “Aha, so it didn’t get to boot the system! But what is written on the screen there?”, I thought. After thinking a little about the reasons why the TV does not show anything, I hypothesized that it cannot show the resolution in which the console output is located. On the screen, in fact, it is written ...

11:00 Changed GRUB settings to output 640x480. Helped. It says "Loading Linux 4.19.27-gentoo-r1...". It turned out that he screwed up when assembling the kernel.

11:30 I put genkernel, I will experiment with manual configuration of the kernel later. Not placed! It turns out the jamb with the date. It is better to update it at each launch, a lot depends on this date. I would have set it in the BIOS, but this requires a keyboard ... I change the date to the current one.

14:00 Hooray! The kernel has compiled! Filled the kernel into the bootloader, rebooted. Finally everything worked!

First goal achieved!

Next, I'm going to install CentOS on the second hard drive, also without a keyboard, but from djent! But I will write about this in the second part. In the third part, I will load test a web server with a simple application on both of these systems and compare RPS.

Source: habr.com

Add a comment