├── .gitattributes ├── Makefile ├── README.md ├── data └── fstab ├── vyos.squashfs └── vyos.yaml /.gitattributes: -------------------------------------------------------------------------------- 1 | vyos.squashfs filter=lfs diff=lfs merge=lfs -text 2 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | all: pack-lxd 2 | 3 | unpack: 4 | unsquashfs -f -d source/ vyos.squashfs 5 | 6 | addon: unpack 7 | mkdir source/config 8 | cp source/opt/vyatta/etc/config.boot.default source/config/config.boot 9 | cp data/fstab source/etc/fstab 10 | chown 0:102 -R source/config 11 | 12 | pack-lxd: addon 13 | distrobuilder pack-lxd --type unified vyos.yaml source 14 | 15 | pack-lxc: addon 16 | distrobuilder pack-lxc vyos.yaml source 17 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # How to install this project in LXC/LXD 2 | 3 | ## Clone this Project 4 | 5 | ``` 6 | git clone https://github.com/jack9603301/vyos-on-lxd 7 | ``` 8 | 9 | ## Download the latest ISO 10 | 11 | ``` 12 | mkdir vyos && cd vyos 13 | wget https://downloads.vyos.io/release/1.1.8/vyos-1.1.8-amd64.iso 14 | ``` 15 | 16 | ## Mount the ISOs file system 17 | 18 | ``` 19 | mkdir rootfs 20 | sudo mount -o loop vyos-1.1.8-amd64.iso rootfs 21 | ``` 22 | 23 | ## extract filesystem.squashfs 24 | 25 | ``` 26 | cp rootfs/live/filesystem.squashfs ../vyos-on-lxd/vyos.squashfs 27 | cd ../vyos-on-lxd/ 28 | ``` 29 | 30 | ## install dependencies 31 | 32 | Please choose the appropriate method for your operating system to install the following dependencies: 33 | 34 | - squashfs-tools 35 | - [distrobuilder(LXC/LXD image build tool)](https://linuxcontainers.org/distrobuilder/introduction/) 36 | 37 | ## Execute LXC/LXD build 38 | 39 | ### with LXC 40 | 41 | ``` 42 | make pack-lxc 43 | ``` 44 | 45 | ## with LXD 46 | 47 | ``` 48 | make pack-lxd 49 | ``` 50 | 51 | # Notice 52 | 53 | Must run in physical NIC pass-through mode 54 | It is recommended to execute the container in privileged mode 55 | This is currently only an initial implementation! 56 | -------------------------------------------------------------------------------- /data/fstab: -------------------------------------------------------------------------------- 1 | /sys /sys sysfs rw,remount defaults 2 | -------------------------------------------------------------------------------- /vyos.squashfs: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:d0eebf6aaf59e51cd9d02969fcc86669b3366ab5fd907487f5096a7165bca601 3 | size 381956096 4 | -------------------------------------------------------------------------------- /vyos.yaml: -------------------------------------------------------------------------------- 1 | image: 2 | name: vyos-rolling 3 | distribution: VyOS 4 | release: rolling 5 | description: |- 6 | Vyos on LXC/LXD {{ image.release }} 7 | architecture: x86_64 8 | 9 | source: 10 | downloader: rootfs-http 11 | url: file:///go/to/path/vyos.squashfs 12 | 13 | packages: 14 | custom_manager: 15 | install: 16 | cmd: echo "No Used" >/dev/null 2>&1 17 | remove: 18 | cmd: echo "No Used" >/dev/null 2>&1 19 | clean: 20 | cmd: echo "No Used" >/dev/null 2>&1 21 | refresh: 22 | cmd: echo "No Used" >/dev/null 2>&1 23 | update: 24 | cmd: echo "No Used" >/dev/null 2>&1 25 | --------------------------------------------------------------------------------