unofficial mirror of help-guix@gnu.org 
 help / color / mirror / Atom feed
* guixsd install questions
@ 2017-01-27  8:29 Divan Santana
  2017-01-27 19:24 ` Marius Bakke
  2017-01-28 23:20 ` Ludovic Courtès
  0 siblings, 2 replies; 11+ messages in thread
From: Divan Santana @ 2017-01-27  8:29 UTC (permalink / raw)
  To: help-guix

Hi All,

Few newbie questions regarding install.

* How to get sshd running on install image for easier remote install.

Useful for a VM:

I'm doing this nasty hack for now.

Get ssh working on boot image:
#+BEGIN_EXAMPLE
guix package -i shadow openssh
export PATH="/root/.guix-profile/bin:/root/.guix-profile/sbin${PATH:+}$PATH"
zile /etc/passwd # add sshd account
zile /etc/shadow # add sshd account
mkdir /etc/ssh
echo "PermitRootLogin yes" > /etc/ssh/sshd_config
ssh-keygen -t ecdsa -N "" -f /etc/ssh/ssh_host_ecdsa_key
`which sshd`
passwd root
#+END_EXAMPLE

Sure there's a better way then the above hack?

Then then use Emacs tramp to put my install system manifest in place:

Using emacs to remotely edit the file, which requires sshd on the
install image.

#+BEGIN_SRC emacs-lisp
  ;; TRAMP and guix settings
  (setq tramp-default-method "ssh")
  ;; workaround for guixsd
  ;; https://lists.gnu.org/archive/html/help-guix/2016-10/msg00049.html
  ;; Make sure we work on remote guixsd machines :)
  (setq tramp-remote-path
        (append tramp-remote-path
                '("~/.guix-profile/bin" "~/.guix-profile/sbin"
                  "/run/current-system/profile/bin"
                  "/run/current-system/profile/sbin")))
#+END_SRC
Then one can open this path:
=/ssh:root@192.168.122.236:/mnt/etc/config.scm= with tramp.

* How to setup encrypted root with mdadm software raid 0?

I've done the following and none are working yet.

Partitioning
#+BEGIN_EXAMPLE
fdisk, one partition of each only marked as fd
mdadm --create --level=0 --raid-devices=2 /dev/md0 /dev/vd[bc]1
cryptsetup luksFormat /dev/md0
cryptsetup luksOpen /dev/md0 crypt
mkfs.ext4 -L root -m2 /dev/mapper/crypt
mount /dev/mapper/crypt /mnt
#+END_EXAMPLE

Then do the install with this guile code:
#+BEGIN_SRC scheme
  ;; two devices in raid0 striped with LUKS full disk encryption.
  (bootloader (grub-configuration (device "/dev/vdb")))
  (mapped-devices (list
                   (mapped-device
                    (source (list "/dev/vdb1" "/dev/vdc1"))
                    (target "/dev/md0")
                    (type raid-device-mapping))
                   (mapped-device
                    (source (uuid "fb29c6f6-b2c0-4c87-8651-4962b7125dc0"))
                    (target "crypt")
                    (type luks-device-mapping))))
#+END_SRC

And this too:
#+BEGIN_SRC scheme
  (file-systems (cons (file-system
                       (device "root")
                       (title 'label)
                       (mount-point "/")
                       (type "ext4"))
                      %base-file-systems))
#+END_SRC

The above fails. So tried another install with device like so

#+BEGIN_SRC scheme
  (file-systems (cons (file-system
                       (device "/dev/mapper/crypt")
                       (title 'device)
                       (mount-point "/")
                       (type "ext4"))
                      %base-file-systems))
#+END_SRC

That failed, I then tried the UUID method, via =blkid
/dev/mapper/crypt=, get the UUID and did another install with this
snippet instead:

#+BEGIN_SRC scheme
  (file-systems (cons (file-system
                       (device (uuid "4dab5feb-d176-45de-b287-9b0a6e4c01cb"))
                       (title 'uuid)
                       (mount-point "/")
                       (type "ext4"))
                      %base-file-systems))
#+END_SRC

This fails with waiting for root device.

* How to recover a failed install. How to chroot a broken system and
fix?

You can see why I'm asking this. When my failed crypt install fails, I
sometimes just want to reconfigure the system to try another method.

Now when I run =guix system init /mnt/etc/config.scm /mnt= to recover
the install to the same preveiously install disk it re-downloads,
re-compiles and redoes the whole install, instead of just perhaps
changing grub to (attempt to) fix my crypt issue.

Ideally I want to chroot into the installed (and broken) environment and
do a =guix system reconfigure /etc/config.scm=.

How can one do this?

* How to use a proxy to do the install

This is from the boot install media.

I've read the docs on using proxy though it's not working like I expect.
Prob doing something wrong.

I've done the following

On tt1 I did =herd stop guix-daemon=
Then exported proxy like so:
export http_proxy=http://server.domain.co.za:8080/ ; export ftp_proxy=$http_proxy ; export https_proxy=$http_proxy

=herd start guix-daemon=

=guix package -i something= and note the proxy is not working.
Try do the install =guix system init /mnt/etc/config.scm /mnt= and note
the proxy env is not being used.

Greetings from South Africa :)
--
Best regards,

Divan Santana

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2017-07-02 14:25 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-01-27  8:29 guixsd install questions Divan Santana
2017-01-27 19:24 ` Marius Bakke
2017-01-27 19:29   ` Marius Bakke
2017-02-05  7:14   ` Divan Santana
2017-01-28 23:20 ` Ludovic Courtès
2017-02-05  7:25   ` Divan Santana
2017-02-07 14:48     ` Ludovic Courtès
2017-06-30 20:49   ` Divan Santana
2017-07-01 14:05     ` Ludovic Courtès
2017-07-02  4:53       ` Divan Santana
2017-07-02 14:25         ` Ludovic Courtès

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).