[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

guix deploy: doesn't exist error

From: Dmitry Matveyev
Subject: guix deploy: doesn't exist error
Date: Sun, 22 Jan 2023 21:20:49 +0600
User-agent: mu4e 1.8.13; emacs 28.2.50

I'm trying to use guix deploy to install a Guix System at
using a minimal iso image file of Guix System. So I do:

1. Create a minimal ISO image using guix system
2. Boot the ISO image on a remote server
3. Use guix deploy to install the system

I fail at step 3 with " doesn't exist" error. Below is (1) the
end of the guix deploy command output and (2) my complete instruction of
what I do up to guix deploy command.

I use Guix version d6f1b9487da3e6f9c3ef49dea9c97c0408a25777 on Arch Linux.

The end of guix deploy command is:

building /gnu/store/m6vv3zqf792spnc9fmsnbbfah1cyjx35-grub.cfg.drv...
building /gnu/store/nyb01ypw9wbhvk1yqzgpd1brydc15llq-remote-exp.scm.drv...
guix deploy: sending 3 store items (0 MiB) to ''...

guix deploy: error: failed to deploy vm: failed to install bootloader on

%exception #<inferior-object #<&message message:
--boot-directory //boot --bootloader-id=Guix --efi-directory/boot/efi'
exited with status 1; output follows:\n\n
doesn't exist. Please specify --target or --directory.\n">>

The complete instruction of my current deployment process:

# How to set up Guix System on VPS

## Preparation

We need to have basic things for setting up.

1. Set up DNS record for future HTTPS support, for example, on

2. Register at the hosting provider site, for example, on <>.

3. If not using the Guix System as your desktop operating system, install Guix
   on your system as a package manager

## Create and deploy the first image

1. Create a new directory for this deployment and `cd` there.

2. Generate ssh keys for authentication: run `ssh-keygen`, choose to store them
   in the current directory `./`.

3. Copy this to `base_vm.scm`

``` scm
(use-modules (gnu))
(use-service-modules networking ssh)
(use-package-modules bootloaders ssh)

 (host-name "vm")
 (locale "en_US.utf8")
 (timezone "Etc/UTC")
 (bootloader (bootloader-configuration
              (bootloader grub-bootloader)
              (targets '("/dev/vda"))
              (terminal-outputs '(console))))
 (file-systems (cons (file-system
                      (mount-point "/")
                      (device "/dev/vda1")
                      (type "ext4"))
  (append (list (service dhcp-client-service-type)
                (service openssh-service-type
                          (openssh openssh-sans-x)
                          (password-authentication? #f)
                          (permit-root-login #t)
                           ;; Authorise our SSH key.
                           `(("root" ,(local-file "")))))))

4. Use a minimal config in `base_vm.scm` to generate the base image of the
   operating system, this will take a while on the very first run. Note that you
   might need to change `--image-type` to something else like `qcow2` if the
   hosting provider only supports limited options. See all available formats
   with `guix system --list-image-types`.

guix system image --save-provenance --image-type=iso9660 base_vm.scm

At the very end there will be a path to the generated image such as


5. Upload this image to the hosting provider. In Vultr it is required to put it
   online, for example, to <> as it allows 2 GB free
   space. Only then it can be added as an iso image in a separate step.

6. Choose options for the virtual server, select the uploaded image and
   instantiate the system.

7. Try logging in with ssh, for example:

ssh -i id_rsa root@

8. If booted from iso on Vultr, it is necessary to partition the disk too:

``` shell
fdisk /dev/vda

# Create new GPT table

# Create partition for /boot, set size to 300 MB and change its type to UEFI

# Create partition for root partition for all the remaining space
# Press Enter many times
# This is "Linux root (x86-64)

# Check that everything is good

# Write partitions and quit

9. If everything is successful, quit with Ctrl+D.

10. Generate Guix signing keys with `sudo guix archive --generate-key`, now they
    are available at `/etc/guix`.

11. Save this template to `first_deploy.scm`:

(use-modules (gnu) (guix))
(use-service-modules networking ssh admin)
(use-package-modules bootloaders ssh)

(define os
    (host-name "vm")
    (locale "en_US.utf8")
    (timezone "Etc/UTC")
    (bootloader (bootloader-configuration
                 (bootloader grub-efi-bootloader)
                 (targets '("/boot/efi"))))
    (file-systems (append
                   (list (file-system
                          (device "/dev/vda2")
                          (mount-point "/")
                          (type "ext4"))
                          (device "/dev/vda1")
                          (mount-point "/boot/efi")
                          (type "vfat")))
      (list (service openssh-service-type
                      (openssh openssh-sans-x)
                      (password-authentication? #f)
                      (permit-root-login #t)
                       `(("root" ,(local-file ""))))))
            (service dhcp-client-service-type)
            (service unattended-upgrade-service-type))
      (modify-services %base-services
                       ;; The server must trust the Guix packages you build. If 
you add the signing-key
                       ;; manually it will be overridden on next `guix deploy` 
                       ;; "error: unauthorized public key". This automatically 
adds the signing-key.
                       (guix-service-type config =>
                                           (inherit config)
                                            (append (list (local-file 

(list (machine
       (operating-system os)
       (environment managed-host-environment-type)
       (configuration (machine-ssh-configuration
                       (host-name "")
                       (system "x86_64-linux")
                       ;; Update this after seeing an error running `guix 
                       (host-key "ssh-ed25519 
                       (user "root")
                       ;; Use this key to communicate with the machine.
                       (identity "id_rsa")))))

12. Try deploying with `guix deploy first_deploy.scm`, you will see an error 
    host key doesn't match, it is expected, update it in the machine
    configuration accordingly:

(host-key "ssh-ed25519 AAAAC3N123456789mZwG+Y8Xk+XN123456789GNJ1RU3BkuUU")

13. Re-run `guix deploy first_deploy.scm` to finally install the system. Note
    that you may need to run it several times in case it fails because of errors
    such as "Throw to key `guile-ssh-error' with args `("channel-open-session"
    "Channel openingfailure: channel 67 error (2) open failed" #<input-output:
    channel (closed) 7f96971b8760> #f)'" - this is probably a transient error,
    see discussion at <>.

## References

- <> -
  blog post on Guix
- <> - deploying a
- <> - deploying on
  Digital Ocean Guix->Guix
- <> - deploying on Digital
- <> -
  example config


reply via email to

[Prev in Thread] Current Thread [Next in Thread]