unofficial mirror of help-guix@gnu.org 
 help / color / mirror / Atom feed
From: Maxim Cournoyer <maxim.cournoyer@gmail.com>
To: help-guix <help-guix@gnu.org>
Subject: Installing Guix System on an OVH VPS (Virtual Private Server)
Date: Sat, 31 Aug 2024 21:40:18 +0900	[thread overview]
Message-ID: <87ttf0amrx.fsf@gmail.com> (raw)

Hi,

I've recently experimented with installing Guix System on a cheap OVH
VPS server, and here are my findings in case it helps someone else:

1. The base images do not include Guix System, so start with something
like Debian 12 or newer.

2. From their web interface, reboot into their rescue mode.

3. Make enough space on the rescue root to have about 500 MiB free,
enough for 'apt install guix' to succeed.  I found one unused kernel
image which freed a lot of space, along with 'gcc'.

4. Recreate /dev/sdb1 from 20 GB to 15 GB, and create a new 5 GB
partition after that, as /dev/sdb2.  Mount /dev/sdb2 as /gnu in the
rescue.  This is because the rescue file system is too small to run
'guix system init'.

I've also opted for Btrfs file system, and made sure to mount the
partitions with 'mount -o compress=zstd ...' to shrink space usage as
much as I could.

5. Run 'guix system init /mnt your-config.scm', where /mnt is the mount
point for /dev/sdb1.  For the config, start with the bare-bones.tmpl
config.  Use plain GRUB (BIOS, not UEFI), and add the virtio_scsi module
to the initrd:

--8<---------------cut here---------------start------------->8---
  (initrd-modules (cons "virtio_scsi"    ; Needed to find the disk
                        %base-initrd-modules))
--8<---------------cut here---------------end--------------->8---

The other important bit to see the kernel messages at boot is this:

--8<---------------cut here---------------start------------->8---
  (kernel-arguments (list "console=ttyS0 console=tty0"))
--8<---------------cut here---------------end--------------->8---


Here's what my actual config file looks like, with some parts redacted:

--8<---------------cut here---------------start------------->8---
(use-modules (gnu))
(use-service-modules networking ssh)
(use-package-modules ssh)

(operating-system
  (host-name "vps-xxx")
  (locale "en_US.utf8")

  (bootloader (bootloader-configuration
               (bootloader grub-bootloader)
               (targets '("/dev/sdb"))))

  (kernel-arguments (list "console=ttyS0 console=tty0"))

  (file-systems (cons* (file-system
                         (device (uuid "bbf61fb4-b6ce-44af-ac57-1850cd708965"))
                         (mount-point "/")
                         (type "btrfs")
                         (options "compress=zstd"))
                       %base-file-systems))

  (initrd-modules (cons "virtio_scsi"    ; Needed to find the disk
                        %base-initrd-modules))

  ;; This is where user accounts are specified.  The "root"
  ;; account is implicit, and is initially created with the
  ;; empty password.
  (users (cons (user-account
                (name "some-user")
                (group "users")
                ;; Adding the account to the "wheel" group
                ;; makes it a sudoer.  Adding it to "audio"
                ;; and "video" allows the user to play sound
                ;; and access the webcam.
                (supplementary-groups '("wheel")))
               %base-user-accounts))

  ;; Add services to the baseline: a DHCP client and an SSH
  ;; server.  You may wish to add an NTP service here.
  (services
   (append
    (list (service dhcp-client-service-type)
          (service openssh-service-type
                   (openssh-configuration
                    (openssh openssh-sans-x)
                    (port-number 2222)
                    (authorized-keys
                     `(("some-user" ,(plain-file "maxim-ssh.pub"
                                                 "ssh-XXX XXXXXXXX")))))))
    %base-services))

  (sudoers-file
   (plain-file "sudoers"
               (string-append (plain-file-content %sudoers-specification)
                              "some-user ALL = NOPASSWD: ALL\n"))))
--8<---------------cut here---------------end--------------->8---

The sudoers-file part is so that I can 'guix deploy' to it.

Happy hacking!

-- 
Maxim


             reply	other threads:[~2024-08-31 12:40 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-08-31 12:40 Maxim Cournoyer [this message]
2024-08-31 15:56 ` Installing Guix System on an OVH VPS (Virtual Private Server) Edouard Klein
2024-08-31 16:11   ` Edouard Klein
2024-09-02  1:22     ` Maxim Cournoyer
2024-09-02  1:20   ` Maxim Cournoyer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87ttf0amrx.fsf@gmail.com \
    --to=maxim.cournoyer@gmail.com \
    --cc=help-guix@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).