help-guix
[Top][All Lists]
Advanced

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

Port forwarding and `guix system vm`


From: Christopher Lemmer Webber
Subject: Port forwarding and `guix system vm`
Date: Tue, 07 Jul 2020 14:16:23 -0400
User-agent: mu4e 1.4.9; emacs 26.3

Hello!

I've been trying to figure out how to do port forwarding with
`guix system vm` and have not (alas) yet succeeded.

Here's what I've tried so far:

  # testing forwarding http
  `guix system vm guix-config-dustycloud.scm 
--share=$HOME/tmp/guix-vm-exchange=/exchange` -nic hostfwd=tcp::8088-:80
  # testing forwarding ssh
  `guix system vm guix-config-dustycloud.scm 
--share=$HOME/tmp/guix-vm-exchange=/exchange` -nic hostfwd=tcp::10022-:22

In both the case of trying to ssh and trying to access via a web
browser, it just hangs.

I can also add all the rest of the -nic stuff the manual recommends:

  `guix system vm guix-config-dustycloud.scm 
--share=$HOME/tmp/guix-vm-exchange=/exchange` -nic 
user,model=virtio-net-pci,hostfwd=tcp::8088-:80

... same problem.  (However, it looks like the script adds the
virtio-net-pci and stuff these days, so I'm not sure that stuff is
necessary...)

Any ideas?

config looks like:

  (operating-system
    (host-name "dustycloud")
    (timezone "America/")
    (locale "en_US.UTF-8")

    ;; TODO: this will need to switch out depending on if this is in a local VM 
or not
    (bootloader (grub-configuration (target "/dev/sda")))
    (file-systems (cons (file-system
                          (device "/dev/sda1")
                          (mount-point "/")
                          (type "ext4"))
                        %base-file-systems))

    (users (cons (user-account
                  (name "cwebber")
                  (group "users")
                  ;; Adding the account to the "wheel" group
                  ;; makes it a sudoer.
                  (supplementary-groups '("wheel"))
                  (home-directory "/home/cwebber"))
                 %base-user-accounts))

    (packages (cons* tcpdump
                     nss-certs         ;for HTTPS access
                     gnutls
                     git
                     rsync
                     openssh
                     lynx
                     %base-packages))

    (services (cons* (service openssh-service-type
                              (openssh-configuration
                               (password-authentication? #f)
                               (authorized-keys
                                `(("cwebber" ,(local-file 
"/home/cwebber/.ssh/id_rsa.pub"))))))
                     (service mcron-service-type
                              (mcron-configuration (jobs (list %gc-job))))
                     (service nginx-service-type
                              (nginx-configuration
                               (server-blocks
                                (list (nginx-server-configuration
                                       (server-name '("www.dustycloud.org" 
"dustycloud.org"))
                                       (root "/srv/http/dustycloud.org")
                                       (listen '("80")))))))
                     %base-services)))



reply via email to

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