all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Sharing GNU guix with VMs (in this case KVM)
@ 2015-10-13 13:10 Pjotr Prins
  0 siblings, 0 replies; only message in thread
From: Pjotr Prins @ 2015-10-13 13:10 UTC (permalink / raw
  To: guix-devel

Just wanted to share the following:

This is my setup for sharing GUIX from the host with running VMs. GUIX
can be mounted read-only and it is similar to Ricardo's setup on an
HPC compute cluster: http://elephly.net/posts/2015-04-17-gnu-guix.html

Sharing Guix with host and KVM, start up the VM with something like

  qemu-system-x86_64 -enable-kvm -hda hda.img \
    -m 1024M \
    -smp 2 \
    -redir tcp:2222::22 \
    -fsdev local,security_model=passthrough,id=fsdev0,path=/gnu \
    -device virtio-9p-pci,id=fs0,fsdev=fsdev0,mount_tag=gnu \
    -fsdev local,security_model=passthrough,id=fsdev1,path=/var/guix \
    -device virtio-9p-pci,id=fs1,fsdev=fsdev1,mount_tag=guix 

Mount guix directories inside KVM

  ssh -p 2222 localhost

as root:

  mkdir /gnu
  mkdir /var/guix
  mount -t 9p -o trans=virtio,version=9p2000.L gnu /gnu
  mount -t 9p -o trans=virtio,version=9p2000.L guix /var/guix

Now we have GNU Guix visible. Create the root profile - which will
match that on the host

  ln -sf /var/guix/profiles/per-user/root/guix-profile \
         /root/.guix-profile

The same for other users that need to access a profile, e.g., as a
user

  ln -sf /var/guix/profiles/per-user/$USER/guix-profile \
         $HOME/.guix-profile

The only catch (really) is that all software has to be installed on
the host (which has a running guix-daemon) and VM users need to have a
matching host profile.

Pj.

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2015-10-13 13:12 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-10-13 13:10 Sharing GNU guix with VMs (in this case KVM) Pjotr Prins

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.