README.md 4.52 KB
Newer Older
Christian Rebischke's avatar
Christian Rebischke committed
1
# arch-boxes
2
3
4
5
6
7
8
[![CI Status](https://gitlab.archlinux.org/archlinux/arch-boxes/badges/master/pipeline.svg)](https://gitlab.archlinux.org/archlinux/arch-boxes/-/pipelines)

- [Vagrant Cloud](https://app.vagrantup.com/archlinux/boxes/archlinux)
- [Browse latest QEMU build artifacts](https://gitlab.archlinux.org/archlinux/arch-boxes/-/jobs/artifacts/master/browse?job=build:qemu)
- [Browse latest VirtualBox build artifacts](https://gitlab.archlinux.org/archlinux/arch-boxes/-/jobs/artifacts/master/browse?job=build:virtualbox)
- [Download latest QEMU QCOW2 image](https://gitlab.archlinux.org/archlinux/arch-boxes/-/jobs/artifacts/master/raw/output-qemu/packer-qemu?job=build:qemu)
- [Download latest VirtualBox disk image](https://gitlab.archlinux.org/archlinux/arch-boxes/-/jobs/artifacts/master/download?job=build%3Avirtualbox)
Christian Rebischke's avatar
Christian Rebischke committed
9
10
11
12
13
14
15
16
17
18
19
20
21

Arch-boxes provides automated builds of the Arch Linux releases for
different providers and post-processors. Check the providers or post-processor sections if you want to know
which are currently supported.

## Dependencies

You'll need the following dependencies:

* packer (for basic usage)
* vagrant (for vagrant images)
* qemu (for libvirt provider support)
* virtualbox (for virtualbox support)
Rafael Soares's avatar
Rafael Soares committed
22
* VMware Workstation Pro (for vmware support)
Christian Rebischke's avatar
Christian Rebischke committed
23

24
25
26
27
28
29
30
31
32
33
34
35
36
37
## variables
Here is an overview over all variables you can set in `vagrant.json` or
`local.json`:

* `iso_url`: the url to the ISO. This can be an url or a filepath
  beginning with `file://`
* `iso_checksum_url`: the url to the checksum file. This can be an url
  or a filepath beginning with `file://`
* `iso_checksum_type`: this specifies the hashing algorithm for the
  checksum.
* `disk_size`: this specifices the disk size in bytes.
* `memory`: this specifies the size of the RAM in bytes.
* `cpus`: this specifies the number of cores for your VM.
* `headless`: this sets GUI on or off.
38
39
40
41
* `vagrant_cloud_token`: here you can specify the vagrant cloud token for 
  uploading your box to the vagrantcloud. If you don't have a vagrant cloud 
  token you can ignore this variable. Without a token the boxes will be
  built, but the upload step step will fail.
42
43
44
45
46
47
48
* `write_zeroes`: this variable is empty. if you set any string in this
  variable it will fill the box with zeros to reduce the size. **DO NOT
  use this if you are running a SSD. It will harm your SSDs lifetime**
* `boot_wait`: this specifies the time packer should wait for booting up
  the ISO before entering any command.

## how to start the build process locally
49
50
51
If you want to build the boxes locally without uploading them to the Vagrant
cloud you need to edit the `local.json` before you start the build. set the
right `iso_url` and the right `iso_checksum_url`. Then you can start the build
52
53
for virtualbox only with the following command:

54
`packer build -only=virtualbox-iso local.json`
55
56
57

## how to start the build process for official builds
The official builds are done on our Arch Linux Buildserver.
Christian Rebischke's avatar
Christian Rebischke committed
58
59
60
61
62
63
64

`packer build vagrant.json`

## providers

* virtualbox-iso
* qemu/libvirt
Rafael Soares's avatar
Rafael Soares committed
65
* vmware-iso
Christian Rebischke's avatar
Christian Rebischke committed
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83

## post-processors

* vagrant

## Troubleshooting

### Parallel build fails
If the parallel build fails this is mostly because the KVM device is
already occupied by a different provider. You can use the build option
`parallel=false` for building the images in a queue instead of parallel.
But don't be surprised that that the build process will take longer. Any
other option is to disable KVM support for all other providers except
one.

Start `packer` with `-parallel=false`:

`packer build -parallel=false vagrant.json`
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109

### Checking cloud-init support in our qcow2 images:

```bash
$ packer build cloud.json
$ cp release/Arch-Linux-cloudimg-amd64-2020-02-24.img disk.img

# Copied from (with minor changes): https://cloudinit.readthedocs.io/en/latest/topics/datasources/nocloud.html
$ { echo instance-id: iid-local01; echo local-hostname: cloudimg; } > meta-data

$ printf "#cloud-config\npassword: passw0rd\nchpasswd: { expire: False }\nssh_pwauth: True\n" > user-data

## create a disk to attach with some user-data and meta-data (require cdrkit)
$ genisoimage  -output seed.iso -volid cidata -joliet -rock user-data meta-data

## create a new qcow image to boot, backed by your original image
$ qemu-img create -f qcow2 -b disk.img boot-disk.img

## boot the image and login as 'arch' with password 'passw0rd'
## note, passw0rd was set as password through the user-data above,
## there is no password set on these images.
$ qemu-system-x86_64 -m 256 \
   -net nic -net user,hostfwd=tcp::2222-:22 \
   -drive file=boot-disk.img,if=virtio \
   -drive file=seed.iso,if=virtio
```