Skip to content

Instantly share code, notes, and snippets.

@higebu
Last active August 1, 2023 14:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save higebu/640f6b4ea5531eb4e1dbf6ffe640cd22 to your computer and use it in GitHub Desktop.
Save higebu/640f6b4ea5531eb4e1dbf6ffe640cd22 to your computer and use it in GitHub Desktop.
VyOS VM on LXD

Import vyos image

lxc image import --alias vyos {path to lxd image file}

Init vyos instance

lxc profile set default security.secureboot=false
lxc init vyos vyos1 --vm --profile default
cat <<'EOF' | lxc config set vyos1 cloud-init.user-data -
config:
  user.user-data: |
    #cloud-config
    vyos_config_commands:
      - set system host-name vyos1
      - set system login user vyos authentication plaintext-password "vyos"
description: VyOS Initial Config
devices:
  config:
    source: cloud-init:config
    type: disk
EOF
lxc config device add vyos1 config disk source=cloud-init:config

Run vyos instance

lxc start vyos1
# or
lxc start vyos1 --console

Login as vyos user

lxc exec vyos1 -- su --login vyos
@higebu
Copy link
Author

higebu commented Aug 1, 2023

sudo apt-get install build-essential bc kmod cpio flex libncurses5-dev libelf-dev libssl-dev dwarves bison
cd ./packages/linux-kernel/
git clone --depth 1 -b v6.1.42 https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
./build-kernel.sh

@higebu
Copy link
Author

higebu commented Aug 1, 2023

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment