unofficial mirror of help-guix@gnu.org 
 help / color / mirror / Atom feed
From: George myglc2 Clemmer <myglc2@gmail.com>
To: help-guix <help-guix@gnu.org>
Subject: How to ssh to a QEMU XFCE desktop vm-image?
Date: Sun, 25 Feb 2018 22:37:22 -0500	[thread overview]
Message-ID: <86h8q4a0b1.fsf@gmail.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 1695 bytes --]

I have ssh working to a server image ...

nemo:~ $ ssh g1@server02.local
Last login: Sun Feb 25 22:11:42 2018 from fe80::1ccf:c589:7e5f:a21f%eth0

... but not to a similar xFCE desktop VM image ...

nemo:~ $ ssh g1@desktop01.local -vvv
OpenSSH_7.6p1, LibreSSL 2.6.2
debug1: Reading configuration data /Users/glc/.ssh/config
debug1: /Users/glc/.ssh/config line 48: Applying options for *
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 48: Applying options for *
debug2: ssh_connect_direct: needpriv 0
debug1: Connecting to desktop01.local port 22.
ssh: connect to host desktop01.local port 22: Connection refused

The VMs are built like this ...

	time guix system vm-image -M 4 -c 4 \
	     --image-size=5GB $VMDIR/$NAME.scm

The server runs this way ...

	sudo qemu-system-x86_64 \
	    -name $NAME \
	    -net tap,ifname=$NAME,script=$PWD/qemu-ifup,downscript=$PWD/qemu-ifdn \
	    -net nic,model=virtio,macaddr=$MACADDR \
	    -enable-kvm \
	    -m 5120 \
	    -daemonize \
	    -display none \
	    $VMDIR/vm.img

I run the desktop this way ...

	sudo qemu-system-x86_64 \
	    -name $NAME \
	    -net tap,ifname=$NAME,script=$PWD/qemu-ifup,downscript=$PWD/qemu-ifdn \
	    -net nic,model=virtio,macaddr=$MACADDR \
	     -enable-kvm \
	     -m 5120 \
	     -k en-us \
	     -vga qxl \
	     -spice addr=127.0.0.1,port=3001,disable-ticketing \
	     -device virtio-serial \
	     -chardev spicevmc,id=vdagent,debug=0,name=vdagent \
	     -device virtserialport,chardev=vdagent,name=com.redhat.spice.0 \
	     -daemonize \
	     $VMDIR/vm.img

... and can log in using the SPICE remote-viewer.

How do I enable ssh in to the desktop VM?

TIA - George


[-- Attachment #2: desktop --]
[-- Type: application/octet-stream, Size: 1540 bytes --]

;;; desktop v1 config
(use-modules (gnu))
(use-modules (gnu system nss))
(use-service-modules ssh) ; openssh-service-type
(use-service-modules spice)
(use-service-modules desktop)
(use-service-modules networking) ; dhcp-client-service
(use-package-modules
 base                  ; glibc-utf8-locales
 certs                 ; nss-certs
 emacs
 gnome                 ; gvfs
 linux                 ; mdadm
 screen
 ssh                   ; openssh mosh
 xorg
 )
(operating-system
  (host-name "v1")
  (timezone "America/New_York")
  (locale "en_US.utf8")
  (bootloader (grub-configuration (target "/dev/sda")))
  (file-systems (cons (file-system
			(device "g1sd")
			(title 'label)
			(mount-point "/")
			(type "ext4"))
		      %base-file-systems))
  (users (cons*
	  (user-account
	   (name "g1")
	   (group "users")
	   (supplementary-groups '("wheel" "netdev"))
	   (home-directory "/home/g1"))
	  %base-user-accounts))
  (packages
   (cons*
    emacs-no-x-toolkit
    emacs-guix
    gvfs              ;for user mounts
    nss-certs         ;for HTTPS access
    openssh
    screen
    xauth
    %base-packages))
  (services (cons*
	     (service openssh-service-type
		      (openssh-configuration
		       (x11-forwarding? #t)
		       (permit-root-login #t)
		       (authorized-keys
			`(
			  ("g1" ,(local-file "glc.pub"))
			  ("al" ,(local-file "glc.pub"))
			  ("root" ,(local-file "glc.pub"))))))
	     (spice-vdagent-service)
	     (xfce-desktop-service)
	     %desktop-services))
  (name-service-switch %mdns-host-lookup-nss))

[-- Attachment #3: server --]
[-- Type: application/octet-stream, Size: 1533 bytes --]

;;; server v1 config
(use-modules (gnu))
(use-modules (gnu system nss))
(use-service-modules ssh) ; openssh-service-type
(use-service-modules avahi)
(use-service-modules networking) ; dhcp-client-service
(use-package-modules
 base                  ; glibc-utf8-locales
 certs                 ; nss-certs
 emacs
 gnome                 ; gvfs
 linux                 ; mdadm
 screen
 ssh                   ; openssh mosh
 xorg
 )
(operating-system
  (host-name "v1")
  (timezone "America/New_York")
  (locale "en_US.utf8")
  (bootloader (grub-configuration (target "/dev/sda")))
  (file-systems (cons (file-system
			(device "g1sd")
			(title 'label)
			(mount-point "/")
			(type "ext4"))
		      %base-file-systems))
  (users (cons*
	  (user-account
	   (name "g1")
	   (group "users")
	   (supplementary-groups '("wheel"))
	   (home-directory "/home/g1"))
	  %base-user-accounts))
  (packages
   (cons*
    emacs-no-x-toolkit
    emacs-guix
    glibc-utf8-locales
    gvfs              ;for user mounts
    nss-certs         ;for HTTPS access
    openssh
    screen
    xauth
    %base-packages))
  (services (cons*
  	     (dhcp-client-service)
	     (service openssh-service-type
		      (openssh-configuration
		       (x11-forwarding? #t)
		       (permit-root-login #t)
		       (authorized-keys
			`(
			  ("g1" ,(local-file "glc.pub"))
			  ("al" ,(local-file "glc.pub"))
			  ("root" ,(local-file "glc.pub"))))))
	     (avahi-service)
	     (ntp-service)
	     %base-services))
  (name-service-switch %mdns-host-lookup-nss))

             reply	other threads:[~2018-02-26  3:37 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-26  3:37 George myglc2 Clemmer [this message]
2018-02-26 16:51 ` How to ssh to a QEMU XFCE desktop vm-image? Chris Marusich
2018-02-26 18:41   ` George myglc2 Clemmer

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=86h8q4a0b1.fsf@gmail.com \
    --to=myglc2@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).