Add LICENSE and README
This commit is contained in:
parent
34f4d58e3e
commit
a1c634e767
2 changed files with 813 additions and 0 deletions
139
README.org
Normal file
139
README.org
Normal file
|
|
@ -0,0 +1,139 @@
|
|||
* Enable remote installation
|
||||
|
||||
After booting the [[https://guix.gnu.org/en/download/][Gnu Guix System ISO image]], elect to drop into a shell after selecting your language and location.
|
||||
|
||||
Please start =SSH= and setup a non-blank root password.
|
||||
|
||||
#+begin_src sh
|
||||
herd start ssh-daemon
|
||||
passwd
|
||||
#+end_src
|
||||
|
||||
* Prepare the installation
|
||||
|
||||
You can "ssh into" the Gnu Guix System installation: =ssh root@ip_here -p port_here=.
|
||||
|
||||
During new installations with =QEMU=, I typically [[https://serverfault.com/questions/704294/qemu-multiple-port-forwarding][forward port]] =22= to a fixed port number (e.g., =62000=).
|
||||
|
||||
For my personal setup, I'm using =ssh root@localhost -p 62000=.
|
||||
|
||||
** Create partitions
|
||||
Identify your disk partitions (=fdisk -l= can help).
|
||||
|
||||
Create 2 partitions by running =cgdisk /dev/sda= (in my case)
|
||||
- Setup the EFI partition (code =ef00=) of 300 MB (=/dev/sda1= in my case)
|
||||
- Setup the Linux partition (default code) with the remaining disk space (=/dev/sda2= in my case)
|
||||
|
||||
=Write= changes to disk and then =Quit= the =cgdisk= interface.
|
||||
|
||||
** Create an encrypted device
|
||||
|
||||
Encrypt the main partition.
|
||||
|
||||
#+begin_src sh
|
||||
cryptsetup luksFormat --type luks1 /dev/sda2
|
||||
#+end_src
|
||||
|
||||
** Open LUKS device
|
||||
|
||||
Open the encrypted device.
|
||||
|
||||
#+begin_src sh
|
||||
cryptsetup luksOpen /dev/sda2 guixvm
|
||||
#+end_src
|
||||
|
||||
** Prepare installation
|
||||
|
||||
Run all the commands below to configure partitions and setup filesystems.
|
||||
|
||||
#+begin_src sh
|
||||
mkfs.btrfs -L guixroot /dev/mapper/guix
|
||||
|
||||
mount -t btrfs /dev/mapper/guixvm /mnt
|
||||
|
||||
btrfs subvolume create /mnt/root
|
||||
btrfs subvolume create /mnt/boot
|
||||
btrfs subvolume create /mnt/home
|
||||
btrfs subvolume create /mnt/gnu
|
||||
btrfs subvolume create /mnt/data
|
||||
btrfs subvolume create /mnt/log
|
||||
btrfs subvolume create /mnt/swap
|
||||
|
||||
btrfs filesystem mkswapfile --size 4g /mnt/swap/swapfile
|
||||
btrfs subvolume snapshot -r /mnt/root /mnt/root-blank
|
||||
|
||||
umount /mnt
|
||||
|
||||
mount -o subvol=root /dev/mapper/guix /mnt
|
||||
mkdir -p /mnt/home /mnt/gnu /mnt/data /mnt/var/log /mnt/boot /mnt/swap
|
||||
mount -o subvol=home /dev/mapper/guix /mnt/home
|
||||
mount -o subvol=gnu /dev/mapper/guix /mnt/gnu
|
||||
mount -o subvol=data /dev/mapper/guix /mnt/data
|
||||
mount -o subvol=log /dev/mapper/guix /mnt/var/log
|
||||
mount -o subvol=boot /dev/mapper/guix /mnt/boot
|
||||
mount -o subvol=swap /dev/mapper/guix /mnt/swap
|
||||
|
||||
mkfs.vfat /dev/sda1
|
||||
mkdir -p /mnt/boot/efi
|
||||
mount /dev/sda1 /mnt/boot/efi
|
||||
|
||||
herd start cow-store /mnt
|
||||
#+end_src
|
||||
|
||||
* Install the system
|
||||
|
||||
#+begin_src sh
|
||||
mkdir -p /mnt/etc
|
||||
cp config.scm /mnt/etc/config.scm
|
||||
guix system init /mnt/etc/config.scm /mnt
|
||||
#+end_src
|
||||
|
||||
You can now reboot into your new system (shutdown/start or reboot depending on your setup).
|
||||
|
||||
#+begin_src sh
|
||||
reboot
|
||||
#+end_src
|
||||
|
||||
* Setup the new system
|
||||
|
||||
** Update passwords
|
||||
|
||||
Both passwords for the =root= and =user= users are initially empty.
|
||||
|
||||
Let's login as =root= and change that.
|
||||
|
||||
#+begin_src sh
|
||||
passwd
|
||||
passwd user
|
||||
#+end_src
|
||||
|
||||
** Update the system
|
||||
|
||||
You can now continue the configuration process remotely (=ssh user@localhost -p 62000= in my case).
|
||||
|
||||
#+begin_src sh
|
||||
guix pull --timeout=800 --max-silent-time=800
|
||||
sudo guix system reconfigure /etc/config.scm
|
||||
reboot
|
||||
#+end_src
|
||||
|
||||
** Fix the clock
|
||||
|
||||
Connect to the machine remotely (=ssh user@localhost -p 62000= in my case).
|
||||
|
||||
#+begin_src sh
|
||||
guix package -i ntp
|
||||
GUIX_PROFILE="$HOME/.guix-profile"
|
||||
. "$GUIX_PROFILE/etc/profile"
|
||||
sudo ntpdate -s time.nist.gov && sudo hwclock --systohc
|
||||
guix package -r ntp
|
||||
#+end_src
|
||||
|
||||
** User environment setup
|
||||
#+begin_src sh
|
||||
sudo guix system -L ~/src/guix-config reconfigure ~/src/guix-config/hosts/$(hostname).scm
|
||||
sudo guix home -L ~/src/guix-config reconfigure ~/src/guix-config/home/$(hostname).scm
|
||||
#+end_src
|
||||
|
||||
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue