Steps to install Arch Linux via SSH in another machine (guest) automatically:
- Start the live installation.
- Ensure you have internet connection in your guest (run
wifi-menu
and follow the instructions). - Connect via SSH from your host to your guest (details here).
- In your host, clone the installation scripts and execute them:
git clone git://github.com/dtgoitia/alai cd alai ./run.sh
If you are in VirtualBox, configure it to expose the guest port 22 at host's port 2222:
-
Open Settings > Network > Adapter 1 > Advanced > Port Forwarding
-
Create a new rule:
Name | Protocol | Host IP | Host Port | Guest IP | Guest Port My SSH rule | TCP | | 2222 | | 22
More info here
-
On the host, if you have rebooted the VM:
ssh-keygen -R [127.0.0.1]:2222
This command will remove the old fingerprint
-
On the guest:
passwd systemctl start sshd
-
From the host:
$ ssh -p 2222 root@127.0.0.1 The authenticity of host '[127.0.0.1]:2222 ([127.0.0.1]:2222)' can't be established. ECDSA key fingerprint is SHA256:/9MTMlkNq684abDnAIuhJcrT7VYrc2criEAN6GHiDgG. Are you sure you want to continue connecting (yes/no)? yes Warning: Permanently added '[127.0.0.1]:2222' (ECDSA) to the list of known hosts. root@127.0.0.1's password:
-
Type the password set in step 1.
-
If everything went OK, you should be now inside the VM shell. Press
Ctrl+D
to exit. -
From the host:
./run.sh 2222
-
After rebooting, in the guest, login as root and set the password of the just created user:
root passwd dtg
-
Log out (
Ctrl
+D
) and log in as the user.
Installing the base
group of packages installs netctl
to handle the network connections. I will use the networkmanager
package, which should be installed by the installation scripts. There is no need to uninstall netctl
as it's very small (95KB).
The script will also automatically disable netctl
and enable NetworkManager
services. From then on, you can communicate with the NetworkManager
service via the nmcli
CLI client. This client is enough to manage and connect to WiFi networks.
Copy all the dotfiles from the host to the guest:
./install_xmonad.sh 2222
- Install required packages:
sudo pacman -Syu --noconfirm xmonad xmonad-contrib xorg-server xorg-xinit rxvt-unicode
- Set-up X server-client required files:
echo 'xmonad' > ~/.xinitrc echo 'xmonad' > ~/.xsession
- Create xmonad configuration file at
~/.xmonad/xmonad.hs
:import XMonad main = xmonad def { terminal = "urxvt" }
- Create
~/.Xresources
file to customize rxvt-unicode terminal:Ensure to runURxvt*termName: screen-256color URxvt*loginShell: true URxvt*scrollWithBuffer: false URxvt*background: Black URxvt*foreground: White URxvt*scrollBar: false
xrdb ~/.Xresources
when you change the configuration, and then reopen rxvt-unicode.
Incredibly detailed Xresources
settings
- Install xmobar package:
xmobar
. - Add xmobar configuration to
~/.xmobarrc
(see example). - Configure xmonad to start xmobar on start:
mport XMonad import XMonad.Hooks.DynamicLog main = xmonad =<< xmobar defaultConfig { modMask = mod4Mask { terminal = "urxvt" } }
- Open new terminal:
Alt
+Shift
+Enter
- Exit Xmonad:
Alt
+Shift
+Q
- Go to workspace 1, 2...:
Alt
+1
,Alt
+2
, ...
When you start X using a custom .xinitrc
, you need to specify the X config files to be loaded. Otherwise you'll be presented with a plain default settings (white and ugly).
Solution: run xrdb ~/.Xresources
. The new settings should be picked up when you open a new terminal.
In order to load the custom X configurations on start, add the instruction to your .xinitrc
file:
xrdb ~/.Xresources
xmonad
Bear in mind:
- Scripts needs to have
777
permissions:chmod 777 path_to_script
. - Configuration files ending in
CRLF
can cause problems in Linux (XMonad, etc.).