Coder Social home page Coder Social logo

palfrey / guix-vm Goto Github PK

View Code? Open in Web Editor NEW
19.0 6.0 6.0 46 KB

Scripts and support necessary to make a GuixSD Virtualbox image

Home Page: https://tevps.net/blog/2019/7/20/building-a-guixsd-vagrant-box/

Scheme 31.82% Ruby 55.75% Shell 12.43%
vagrant virtualbox guix guixsd hacktoberfest

guix-vm's Introduction

guix-vm

Packer

This repository contains everything you need to get a GuixSD Vagrant environment setup.

These are:

However, for most use cases, you only need Vagrant and the following configuration

Vagrant.require_version ">= 2.1.3"
Vagrant.configure("2") do |config|
    config.vm.box = "palfrey/guixsd"
    config.vagrant.plugins = "vagrant-guixsd-guest"
    config.vm.synced_folder ".", "/vagrant", type: "rsync", rsync__exclude: ".git/", rsync__chown: false
end

and the box and plugins will be automagically installed for you.

Notes

  • The Virtualbox Guest additions don't work, because they assume the existence of ldconfig (see #1) which means that things like the default virtual folders don't work. Rsync works fine though, hence the item for synced_folder above.

Development

For details of the individual items, see the README's in the individual folders.

guix-vm's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

guix-vm's Issues

vagrant up fails with "unsupported compression scheme lzip"

given I tested out this same revision a few months ago this looks suspect:
https://guix.gnu.org/en/blog/2022/sunsetting-gzip-substitutes-availability/

We are on 1.30 though:

"iso_url": "https://ftp.gnu.org/gnu/guix/guix-system-install-1.3.0.x86_64-linux.iso",
so I'm not sure what the problem is. I'll give it a try, but posting this issue ahead of time.

Full trace:

The following SSH command responded with a non-zero exit status.
Vagrant assumes that this means the command failed!

guix package -i rsync

Stdout from the command:



Stderr from the command:

guix package: warning: Consider running 'guix pull' followed by
'guix package -u' to get up-to-date packages and security updates.

substitute: updating substitutes from 'https://ci.guix.gnu.org'... 100.0%
substitute: updating substitutes from 'https://ci.guix.gnu.org'... 100.0%
downloading from https://ci.guix.gnu.org/nar/lzip/mn3ymm3f2r4xjqf8m9fgmadh6b8p6fvr-glibc-utf8-locales-2.28...
Backtrace:
           3 (apply-smob/1 #<catch-closure 1c8d060>)
In ice-9/boot-9.scm:
    705:2  2 (call-with-prompt _ _ #<procedure default-prompt-handle…>)
In ice-9/eval.scm:
    619:8  1 (_ #(#(#<directory (guile-user) 1d11140>)))
In guix/ui.scm:
  1734:12  0 (run-guix-command _ . _)

guix/ui.scm:1734:12: In procedure run-guix-command:
unsupported compression scheme lzip
substitution of /gnu/store/mn3ymm3f2r4xjqf8m9fgmadh6b8p6fvr-glibc-utf8-locales-2.28 failed
killing process 520
killing process 520: No such process
guix package: error: some substitutes for the outputs of derivation `/gnu/store/c4ni4sq1sb9vv5w3a06jnbwy2j0w819k-glibc-utf8-locales-2.28.drv' failed (usually happens due to networking issues); try `--fallback' to build derivation from source

Virtualbox guest additions support

Attempting to run the guest additions installer gets as far as

vagrant@guixsd ~$ sudo /mnt/VBoxLinuxAdditions.run --nox11
Verifying archive integrity... All good.
Uncompressing VirtualBox 5.2.22 Guest Additions for Linux........
VirtualBox Guest Additions installer
Unable to determine correct library path.

This appears to be because it assumes the existence of ldconfig, which isn't true on Guix as there's no system-wide ld.so config.

Add certificates installation

I think it would be nice to have packages with certificate installed. At least I was quite surprised with an error after

git clone https://gitlab.com/...

Is it possible to add the certificates installation steps?

Rsync Failure for /vagrant on MacOS

I'm not sure if it's specific to Mac (I can't test on any other machine, I'm afraid, but I assume it's working for you) but I get this error when I try including the bit given in the README for setting up the /vagrant directory:

There was an error when attempting to rsync a synced folder.
Please inspect the error message below for more info.

Host path: /Users/wammkd/v/
Guest path: /vagrant
Command: "rsync" "--verbose" "--archive" "--delete" "-z" "--copy-links" "--no-owner" "--no-group" "--rsync-path" "sudo rsync" "-e" "ssh -p 2222 -o LogLevel=FATAL   -o ControlMaster=auto -o ControlPath=/var/folders/pd/d549c4910dbcnrft98pvcgrr0000gn/T/vagrant-rsync-20220126-48360-12rlrla -o ControlPersist=10m  -o IdentitiesOnly=yes -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -i '/Users/wammkd/v/.vagrant/machines/default/virtualbox/private_key'" "--exclude" ".vagrant/" "--exclude" ".git/" "/Users/wammkd/v/" "[email protected]:/vagrant"
Error: rsync: This rsync lacks old-style --compress due to its external zlib.  Try -zz.
rsync error: syntax or usage error (code 1) at main.c(1578) [server=3.1.3]
rsync: connection unexpectedly closed (0 bytes received so far) [sender]
rsync error: error in rsync protocol data stream (code 12) at /AppleInternal/BuildRoot/Library/Caches/com.apple.xbs/Sources/rsync/rsync-54.120.1/rsync/io.c(453) [sender=2.6.9]

Release 1.2.0 install to Vagrant cloud

I see in main branch we've got support for Guix 1.2.0, but vagrant cloud only has 1.1.0 deployed.

Can we start a release/deploy effort for this version?

This is particularly important for security via channel authorizations, which currently don't work out the box (needs tweaking channels.scm to remove the introductions or system upgrade, bleh, not great)

ssh: handshake failed: ssh: unable to authenticate, attempted methods

I run your script with some modification. The running is Ok until first reboot that i display at the end of below code.

{
    "min_packer_version": "1.4.0",
    "builders": [{
        "type": "virtualbox-iso", 
        "vm_name": "guixsd1",
        "guest_os_type": "Linux_64",
        "memory": 3000,
        "headless": true,
        "iso_url": "./guix-system-install-1.0.1.x86_64-linux.iso",               
        "iso_checksum": "4ef645465464613513113ab17537bbead7fb41741e47fedab9451524a292a98de1",                    
        "iso_checksum_type": "sha256",                                                                         
        "ssh_username": "root",
        "ssh_password": "password",
        "boot_command": [
            "<enter><wait30s><enter><wait1s><end><up><up><enter><wait1s><down><enter><enter><wait2s><enter>",
            "passwd root<enter>password<enter>password<enter>",
            "herd start ssh-daemon<enter>"
        ],
        "ssh_timeout": "5m",
        "shutdown_command": "shutdown"
    }],
    "provisioners": [
        {
            "type": "shell",
            "inline": [
                "parted -s --align=none /dev/sda mktable gpt mkpart primary ext2 0 100MB mkpart primary ext2 100MB 100% set 1 bios_grub on",
                "mkfs.ext4 -L my-root /dev/sda2",
                "mount LABEL=my-root /mnt",
                "herd start cow-store /mnt",
                "mkdir /mnt/etc"
            ]
        },
                {
            "type": "file",
            "source": "core-config.scm",
            "generated": true,
            "destination": "/mnt/etc/config.scm"
        },
        {
            "type": "shell",
            "inline": [
                "guix system init /mnt/etc/config.scm /mnt",
                "herd stop ssh-daemon"
            ]
        },
        {
            "type": "shell",
            "expect_disconnect": true,
            "skip_clean": true,
            "inline": ["reboot"]
        },
        {
            "type": "shell",
            "pause_before":"10s",
            "inline": ["herd start ssh-daemon"]
        },
.
.
.
[Other Commands]

After reboot. it's stuck and after 5 minutes (ssh timeout) i encounter with below error:

==> virtualbox-iso: copying to
'/mnt'...                                                                                                          
 
    virtualbox-iso: populating '/mnt'...
    virtualbox-iso: bootloader successfully installed on '/dev/sda'
    virtualbox-iso: Service ssh-daemon has been stopped.
==> virtualbox-iso: Provisioning with shell script: /tmp/packer-shell108761660
==> virtualbox-iso: Pausing 10s before the next provisioner...
==> virtualbox-iso: Provisioning with shell script: /tmp/packer-shell812273279
==> virtualbox-iso: Provisioning step had errors: Running the cleanup provisioner, if present...
==>
 virtualbox-iso: Deregistering and deleting
VM...                                                                                              
 
==> virtualbox-iso: Deleting output
directory...                                                                                                  
 
Build 'virtualbox-iso' errored: Error uploading script: ssh:
handshake failed: ssh: unable to authenticate, attempted methods
[publickey none password], no supported methods
remain                                                                                                                  
 
                                                                                                                                                 
 
==> Some builds didn't complete successfully and had
errors:                                                                                      
 
--> virtualbox-iso: Error uploading script: ssh: handshake
failed: ssh: unable to authenticate, attempted methods [publickey none
password], no supported methods
remain                                                                                                                              
 
                                                                                                                                                 
 
==> Builds finished but no artifacts were created.

it seems that a ssh problem but how i could solve this?

Fix Github actions build issues

During #5 I noted various build issues (which I think had maybe always been there looking back), and I've disabled the Github actions for actually building the VM image. It should work, but I'm really not sure why.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.