[How to] Arch Linux on a VC1


#1

This tutorial will guide you through the steps needed to have Arch Linux running on your VC1 instance.

Note: I copied the initial steps of this tutorial from the OpenBSD on a VC1 post, so thanks to zed for that.


Lets get started:

First you need a fresh VC1 instance with any of the available Linux distributions, it doesn’t really matter which one because it will get completely erased (I use Alpine Linux because is a lightweight distro and it gets created very quick).
Note: it doesn’t need to be a fresh instance, you can use an already running one, but remember that we will delete everything from it prior to installing arch, so backup everything you don’t want to loose to a separate volume or download to your local machine.

Now open the server on which you will install arch on Scaleway’s dashboard, in the server dashboard open the console and hit enter to get the login prompt.

The next steps should be done really quick because the initial loading is fast and does not give you much time to go to iPXE console.

  1. Open an SSH session to the server.
  2. Reboot the server over SSH.
  3. Switch to the console on Scaleway’s dashboard.
  4. Press CTRL+b on your keyboard.

If done properly you should no be on iPXE console and have a prompt like iPXE>.

Now type dhcp and hit enter, this step is for PXE to configure the network and get internet access.

iPXE> dhcp
Configuring (net0 de:19:44:0d:50:01)...... ok
iPXE> 

Note: in the previous snippet between parentheses is your MAC address, so it will be different to the one posted here.

Now type initrd http://archlinux.polymorf.fr/iso/2016.10.01/archlinux-2016.10.01-dual.iso

This will load the arch installation iso so we can boot from it, it takes some time for the download to finish.

Note: the link to the iso posted here might go offline or get outdated, just go to the official arch linux downloads page, select a mirror from the France section and replace the link with a new one, just make sure is an iso image.

iPXE> dhcp
Configuring (net0 de:19:44:0d:50:01)...... ok
iPXE> initrd http://archlinux.polymorf.fr/iso/2016.10.01/archlinux-2016.10.01-dual.iso
http://archlinux.polymorf.fr/iso/2016.10.01/archlinux-2016.10.01-dual.iso... ok

Now type chain http://boot.salstar.sk/memdisk iso raw

This will bootstrap PXE to memdisk and the iso will boot.
Note: I got a strange behavior on this step, the characters on the screen got repeated, but it does not affect the installation in any way, just follow the steps.
Now you should be at your standard arch linux boot prompt where you can select which architecture to install, use the arrow keys to select either 32bit or 64bit installation and hit TAB on your keyboard, this will allow you to edit the kernel parameters before booting to it.
Now type console=ttyS0,115200 (there’s a space before console there) and hit return.
Now you are at the archiso login prompt, type root and hit enter.

Note: the next step is optional, it will allow you to continue the installation over SSH and use copy/paste, but you can skip it and continue using Scaleway’s console.

Now you will start the SSH server

Type passwd and hit return, input a secure password when prompted, twice, and remember it.
Type systemctl start sshd and hit return.
Now you can log in to your server over SSH usin user root ans the password you entered.

Now you will install arch linux to the root dir

Remember I told you to backup important files, last chance… enter the following comands:

root@archiso ~ # mount /dev/vda /mnt
root@archiso ~ # rm -rf /mnt/*
zsh: sure you want to delete all the files in /mnt [yn]? y
root@archiso ~ # pacstrap /mnt base base-devel openssh

After pacstrap finishes installing all the packages we need to do the basic system configuration.
You will need the name of your server, scw-###### if you used the default, or whatever you named it otherwise. Also you need to change the en_US.UTF-8 locale to your needs.

root@archiso ~ # arch-chroot /mnt
root@archiso ~ # passwd  # set a strong password here
New password: 
Retype new password: 
passwd: password updated successfully
root@archiso ~ # echo "my_server_name" >/etc/hostname  # change "my_server_name" to your actual server name
root@archiso ~ # echo "LANG=en_US.UTF-8" >/etc/locale.conf
root@archiso ~ # sed -i 's/^#\(en_US.UTF-8 UTF-8\)/\1/g' /etc/locale.gen && locale-gen
Generating locales...
  en_US.UTF-8... done
Generation complete.
root@archiso ~ # ln -s /usr/share/zoneinfo/Europe/Paris /etc/localtime
root@archiso ~ # systemctl enable sshd
root@archiso ~ # systemctl reboot

And that’s it, now you have Arch Linux running on your VC1 instance.


#2

Just two things:
At the end you have to exit chroot before restarting, you can do it with exit.
You have to put your public ssh key again. I could not ssh so i had to put it using the scaleway console.

other than that, excellent tutorial, thank you.


#3

Nice tutorial, but I can’t get it to work unfortunately.
After the chain http://boot.salstar.sk/memdisk iso raw not only are there repeated characters, but also the text is squeezed into a two character wide column. I tried Firefox and Chrome (on windows 10) but same result.

Any ideas?


#4

You can try doing it blindly, just type <TAB><SPACE>console=ttyS0,115200<RETURN> and see if it boots, post back the results, if it doesn’t work we can investigate further.


#5

Sweet, that worked. Thanks a bunch!


#6

Thanks for the tutorial.

I’ve faced an issue with iptables, I was unable to load the modules required to use it. To fix it, simply do this :

wget https://raw.githubusercontent.com/scaleway/image-tools/master/skeleton-common/usr/local/sbin/scw-sync-kernel-modules
chmod +x scw-sync-kernel-modules

rm -rf /lib/modules
./scw-sync-kernel-modules

Source : https://github.com/scaleway/kernel-tools/issues/249#issuecomment-204783501