Hi there,
Brand new Guix user here. I downloaded the qcow image and launched it. Although I didn’t have any trouble getting to the XFCE environment, I had errors with the two tasks listed below:
Add a new user as very well explained by David on his instructional video on 5 reasons to try Guix. However, after editing the config.scm, running the command below returns an error and does not complete the process:
sudo guix system reconfigure config.scm
...
ice-9/boot-9.scm:1685:16: In procedure raise-exception: Git error: unsupported URL protocol
I thought maybe updating the freshly installed image would solve this problem and attempted a guix pull command. That one also returned an error shown on the screenshot below.
At this point, my conclusion is that the qcow image doesn’t provide a functional system that is capable of achieiving the basic post-installation tasks, which wasn’t a smooth and exciting start to Guix for me.
Replying to my own post here. I restarted the VM and both commands reported above worked this time with some warnings but no errors, and seemed like the tasks completed alright.
Unfortunately, there was no directory created under /home for the user I added, although the user existed in the /etc/passwd file. I thought that this would probably be fixed by rebooting the VM again. However, rebooting failed badly with the screenshot below.
Using the grub menu, I rebooted to the first version of the VM, which kind of worked. Several aspects of XFCE was gone, like taskbar, launch menu, etc. Using the right mouse click and context menu, I was able to open up a terminal and run the sudo guix system reconfigure config.scm command once again. This time it didn’t last nearly as long; however, rebooting got me to the same screen.
Perhaps the problem is the qcow2 image, and if I use the iso image instead, I would have better luck. I have to say though that so far I am unimpressed with Guix and I am not sure if I want to spend a few more hours to see if I have better luck with the iso image.
I do appreciate David’s videos and the work put in to this project, and I am probably too dumb to troubleshoot effectively. I guess I was expecting this to be a little more polished.
Thank you so much @Glenneth for being willing to help!
I finally figured the problem. It was the VM’s hard disk partition that was stated wrong in the config.scm file pasted below. The file system should be mounted on /dev/sda2, not 1, which contains the EFI partition. That was the reason for the VM failing to reboot, it was destroying its EFI partition with every rebuild using this file.
Now I figured the issue, the real fun begins. Thank you!
;; This is an operating system configuration for a VM image.
;; Modify it as you see fit and instantiate the changes by running:
;;
;; guix system reconfigure /etc/config.scm
;;
(use-modules (gnu) (guix) (srfi srfi-1))
(use-service-modules desktop mcron networking spice ssh xorg sddm)
(use-package-modules bootloaders certs fonts nvi
package-management wget xorg)
(define vm-image-motd (plain-file "motd" "
\x1b[1;37mThis is the GNU system. Welcome!\x1b[0m
This instance of Guix is a template for virtualized environments.
You can reconfigure the whole system by adjusting /etc/config.scm
and running:
guix system reconfigure /etc/config.scm
Run '\x1b[1;37minfo guix\x1b[0m' to browse documentation.
\x1b[1;33mConsider setting a password for the 'root' and 'guest' \
accounts.\x1b[0m
"))
;;; XXX: Xfce does not implement what is needed for the SPICE dynamic
;;; resolution to work (see:
;;; https://gitlab.xfce.org/xfce/xfce4-settings/-/issues/142). Workaround it
;;; by manually invoking xrandr every second.
(define auto-update-resolution-crutch
#~(job '(next-second)
(lambda ()
(setenv "DISPLAY" ":0.0")
(setenv "XAUTHORITY" "/home/guest/.Xauthority")
(execl (string-append #$xrandr "/bin/xrandr") "xrandr" "-s" "0"))
#:user "guest"))
(operating-system
(host-name "gnu")
(timezone "Etc/UTC")
(locale "en_US.utf8")
(keyboard-layout (keyboard-layout "us" "altgr-intl"))
;; Label for the GRUB boot menu.
(label (string-append "GNU Guix "
(or (getenv "GUIX_DISPLAYED_VERSION")
(package-version guix))))
(firmware '())
;; Below we assume /dev/sda is the VM's hard disk.
;; Adjust as needed.
(bootloader (bootloader-configuration
(bootloader grub-bootloader)
(targets '("/dev/sda"))
(terminal-outputs '(console))))
(file-systems (cons (file-system
(mount-point "/")
(device "/dev/sda1")
(type "ext4"))
%base-file-systems))
(users (cons* (user-account
(name "guest")
(comment "GNU Guix Live")
(password "") ;no password
(group "users")
(supplementary-groups '("wheel" "netdev"
"audio" "video")))
(user-account
(name "testuser")
(comment "GNU Guix Live")
(password "") ;no password
(group "users")
(supplementary-groups '("wheel" "netdev"
"audio" "video")))
%base-user-accounts))
;; Our /etc/sudoers file. Since 'guest' initially has an empty password,
;; allow for password-less sudo.
(sudoers-file (plain-file "sudoers" "\
root ALL=(ALL) ALL
%wheel ALL=NOPASSWD: ALL\n"))
(packages (append (list font-bitstream-vera nss-certs nvi wget)
%base-packages))
(services
(append (list (service xfce-desktop-service-type)
;; Choose SLiM, which is lighter than the default GDM.
(service slim-service-type
(slim-configuration
(auto-login? #t)
(default-user "guest")
(xorg-configuration
(xorg-configuration
;; The QXL virtual GPU driver is added to provide
;; a better SPICE experience.
(modules (cons xf86-video-qxl
%default-xorg-modules))
(keyboard-layout keyboard-layout)))))
;; Uncomment the line below to add an SSH server.
;;(service openssh-service-type)
;; Add support for the SPICE protocol, which enables dynamic
;; resizing of the guest screen resolution, clipboard
;; integration with the host, etc.
(service spice-vdagent-service-type)
(simple-service 'cron-jobs mcron-service-type
(list auto-update-resolution-crutch))
;; Use the DHCP client service rather than NetworkManager.
(service dhcp-client-service-type))
;; Remove some services that don't make sense in a VM.
(remove (lambda (service)
(let ((type (service-kind service)))
(or (memq type
(list gdm-service-type
sddm-service-type
wpa-supplicant-service-type
cups-pk-helper-service-type
network-manager-service-type
modem-manager-service-type))
(eq? 'network-manager-applet
(service-type-name type)))))
(modify-services %desktop-services
(login-service-type config =>
(login-configuration
(inherit config)
(motd vm-image-motd)))
;; Install and run the current Guix rather than an older
;; snapshot.
(guix-service-type config =>
(guix-configuration
(inherit config)
(guix (current-guix))))))))
;; Allow resolution of '.local' host names with mDNS.
(name-service-switch %mdns-host-lookup-nss))