GithubHelp home page GithubHelp logo

fredleb / vagrant-archlinux-aarch64-bootstrap Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 39 KB

Vagrantfile and doc to bootstrap a arch linux image on Aarch64

License: GNU General Public License v3.0

vagrant-archlinux-aarch64-bootstrap's Introduction

vagrant-archlinux-aarch64-boostrap

Vagrantfile and doc to bootstrap a arch linux image on Aarch64

Assumptions

I have setup libvirt to use a conveniently located storage pool "big_pool" for my VMs. You might need to change that.

Usage

Get the latest Arch Linux image for Aarch64

Go to https://archlinuxarm.org/platforms/armv8/generic and download ArchLinuxARM-aarch64-latest.tar.gz to guest/tmp

Vagrant up !

Will build the target image !

Once done, login to the VM and arch-chroot to the Arch Linux machine:

sudo arch-chroot /mnt

It's a good time to run the updates if you plan to pack the image in a box. If you do, clear the pacman cache to make the image smaller:

sudo pacman -Scc

DHCP client-id

NOTE: This is now done at the end of each vagrant up.

The clinet-id used by the DHCP to identify each client is normally derived (as it should be) from the machine's ID contained in /etc/machine-id.

Before we spawn several clones of this installation, we need to empty it (NOT DELETE IT). It will be regenerated at the next boot.

sudo truncate -s 0 /mnt/etc/machine-id

Starting the new VM

Then use the "clone" of the Virtual Machine Manager:

  • do NOT clone the ubuntu disk image
  • do clone the Arch taget dick image
  • then open the description of the new cloned VM and remove the first disk altogether

Go to your pool and delete the cloned nvram variables file: something is wrong with it somehow...

Now you can start the VM and it enjoy far better speed than with the Ubuntu 20.04 server image...

Box it

Remember to clear the machine ID !

All of these instructions must be don in the box directory !

The Vagrantfile that is contained in the box directory will be packed in the box and will be applied as default when using this box.

Getting the disk image

Copy the target dick to a local sparse file:

qemu-img convert -O qcow2 /home/vm/big_pool/archboot_target.qcow2 ./box.img

Packing

I prepare my own Vagrantfile (see below) and metdata.json.

Then I pack them together in a box file:

tar cvzf archlinux-aarch64.box ./metadata.json ./info.json ./Vagrantfile ./box.img

or faster:

tar cv -S --totals ./metadata.json ./info.json ./Vagrantfile ./box.img | pigz -c > archlinux-aarch64.box

And added the box to my local vagrant:

vagrant box add archlinux-aarch64.box --name archlinux-aarch64

vagrant-archlinux-aarch64-bootstrap's People

Contributors

fredleb avatar

Watchers

 avatar

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.