Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Install Vyos on Packet.net

Vyos Install on Packet.net

VyOS defaults to a console rate of “9600”, which is not compliant with packet.net’s SOS. As such, the squashfs image will need to be unpacked, config.boot.default updated to the correct serial number/BAUD rate, and squashfs image recreated.

VyOS 1.8 (stable) or above is required due to the following https://github.com/vyos/live-initramfs/pull/1 issue where the “fetch” command is ran prior to network loading

#install tools we need
sudo apt update && sudo apt install squashfs-tools

#Fetch iso
wget https://downloads.vyos.io/release/1.1.8/vyos-1.1.8-amd64.iso

#create folder for iso
mkdir /tmp/iso

#mount it
sudo mount -o loop vyos-1.1.8-amd64.iso /tmp/iso

#Create directory for the squashfs
mkdir /tmp/squashfs

#unsquash it
sudo unsquashfs -f -d /tmp/squashfs/ /tmp/iso/live/filesystem.squashfs

Now we need to change the tty and BAUD rate in the boot config.

/tmp/squashfs/opt/vyatta/etc/config.boot.default

Line #32: Original-

console {
              device ttyS0 {
              speed 9600

Change to-

console {
              device ttyS1 {
              speed 115200

Now we need to rebuild the squashfs, we need to know the compression and block size that were used in the original.

#Check the original, look for the lines Compression and Block Size
unsquashfs -s /tmp/iso/live/filesystem.squashfs

#Make the new one (using the compression and block size values)
sudo mksquashfs /tmp/squashfs/ /tmp/filesystem.squashfs -comp gzip -b 131072

The following files then need to be hosted on a public url somehwere (and that url added to the ipxe data below)

  • /tmp/iso/live/vmlinuz
  • /tmp/iso/live/initrd.img
  • /tmp/filesystem.squashfs

Now we can setup the server in Packet.net. We need to use the Custom iPXE option and set the user data to the following:

#!ipxe
dhcp
set base http://WEBSERVERIP
kernel ${base}/vmlinuz  
initrd ${base}/initrd.img
imgargs vmlinuz initrd=initrd.img boot=live config console=ttyS1,115200n8 ip=${net0/ip}::${net0/gateway}:${net0/netmask} fetch=${base}/filesystem.squashfs
boot

Note:

  • The web server must be an IP Address not a dns name

And that's it.

@maplewf

This comment has been minimized.

Copy link

commented Sep 23, 2018

Hi,

thanks for your procedure, but I actually have a question here. No matter iPXE or legacy PXE procedure for VyOS, I only got live system booted, what if I want to install it to hard drive automatically in PXE boot? for now, I only can manually do it with install commands after PXE booting on live system. Have this procedure considered it? or I just missed this part?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.