From mboxrd@z Thu Jan 1 00:00:00 1970 From: Pjotr Prins Subject: Sharing GNU guix with VMs (in this case KVM) Date: Tue, 13 Oct 2015 15:10:02 +0200 Message-ID: <20151013131002.GA18242@thebird.nl> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:54839) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZlzNb-00078F-L4 for guix-devel@gnu.org; Tue, 13 Oct 2015 09:12:36 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZlzNW-00018t-Hx for guix-devel@gnu.org; Tue, 13 Oct 2015 09:12:35 -0400 Received: from mail.thebird.nl ([95.154.246.10]:60710) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZlzNW-00018L-Cd for guix-devel@gnu.org; Tue, 13 Oct 2015 09:12:30 -0400 Content-Disposition: inline List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org Sender: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org To: guix-devel@gnu.org 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.