- Notifications
You must be signed in to change notification settings - Fork60
A tool to build a Arch Linux Image for GCE
License
GoogleCloudPlatform/compute-archlinux-image-builder
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
This project provides a script that creates anArchLinux image that can run onGoogle ComputeEngine.
The image is configured to be as close as possible to a base Arch Linuxinstallation, while still allowing it to be fully functional and optimized forCompute Engine. Notable choices made and differences compared to a standardArch Linux installation are the following:
- systemd-boot is used with a UEFI-based boot and a GPT partition table.
- Serial console logging is enabled from kernel command line and journald isconfigured to forward to it.
- Block multiqueue is configured from the kernel command line to optimizeCompute Engine disk performance.
- A minimal initcpio is configured for booting on Compute Engine virtualmachines.
- Root filesystem is ext4.
- Locale is set to en_US.UTF-8 and timezone is set to UTC.
- Network is configured through dhclient.
- Systemd-timesyncd is enabled and configured to use the Compute Engine metadataserver.
- Pacman keyring is configured to be built and initialized on first boot.
- Pacman mirror list is taken fresh from Arch Linux servers at the time theimage is built.
- Linux Guest Environment for Google ComputeEngine isinstalled and enabled.
- An OpenSSH server is installed and enabled, with root login and passwordauthentication forbidden. User SSH keys are deployed and managedautomatically by the Linux Guest Environment as described in thecorrespondingdocumentation.
- Sudo is installed. Permission to use sudo is managed automatically by LinuxGuest Environment.
- Root partition and filesystem are automatically extended at boot usingsystemd-repart and systemd-growfs, to support dynamic disk resizing.
- An additional Pacman repository is used to install and keep theLinux GuestEnvironmentpackages up to date.
You can useCloud SDK to create instanceswith the latest prebuilt Arch Linux image. To do that follow the SDKinstallation procedure, and then run thefollowingcommand:
$gcloud compute instances create INSTANCE_NAME \ --image-project=arch-linux-gce --image-family=arch
For older images, see the current_images.txt file.
You can build the Arch Linux image yourself with the following procedure:
Install the required dependencies and build the image
$sudo pacman -S --needed arch-install-scripts dosfstools e2fsprogs$git clone https://github.com/GoogleCloudPlatform/compute-archlinux-image-builder.git$cd compute-archlinux-image-builder$sudo ./build-arch-gce
You can also use the
build-arch-gcepackage from the AUR, and runsudo /usr/bin/build-arch-gceIf the build is successful, this will create an image file namedarch-vDATE.tar.gz in the current directory, where DATE is the current date.
Install and configure theCloud SDK.
Copy the image file to Google Cloud Storage:
$gsutil mb gs://BUCKET_NAME$gsutil cp arch-vDATE.tar.gz gs://BUCKET_NAME
Import the image file to Google Cloud Engine as a new custom image:
$gcloud compute images create IMAGE_NAME \ --source-uri=gs://BUCKET_NAME/arch-vDATE.tar.gz \ --guest-os-features=GVNIC,UEFI_COMPATIBLE,VIRTIO_SCSI_MULTIQUEUE
You can now create new instances with your custom image:
$gcloud compute instances create INSTANCE_NAME --image=IMAGE_NAMEThe Google Cloud Storage file is no longer needed, so you can delete it if youwant:
$gsutil rm gs://BUCKET_NAME/arch-vDATE.tar.gz- SeeCONTRIB.md
All files in this repository are under theApache License, Version2.0 unless noted otherwise.
Google Inc. does not provide any support, guarantees, or warranty for thisproject or the images provided.
About
A tool to build a Arch Linux Image for GCE
Topics
Resources
License
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Packages0
Uh oh!
There was an error while loading.Please reload this page.
Contributors11
Uh oh!
There was an error while loading.Please reload this page.