Lxc cosmic builder setup - nutthawit/alpine-dotfile GitHub Wiki
Install and setup the LXC privileged container
ct_name=cosmic
lxc-create --name $ct_name --template download -- --dist archlinux --release current --arch amd64Start the container
lxc-start --name $ct_name --logfile "/tmp/${ct_name}.log" --logpriority debugAttach to container and set the root password
lxc-attach --name $ct_name
passwdNow you can login to the container
lxc-console --name $ct_nameAllowed members of wheel group execute privilege commands
visudoCreate normal user
username=tie
useradd -m -G wheel -s /usr/bin/bash $username
passwd $username
su $usernameInstall a packages required for build
sudo pacman -Syu clang lld make pkgconf justInstall rustc
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | shSet rustflags to use clang linker
cat << 'EOF' > ~/.cargo/config.toml
rustflags = [
"-C", "linker=clang",
"-C", "link-arg=-fuse-ld=lld"
]
EOFMount host path to the container
sudo -s
ct_name=cosmic
h_path=/home/tie/wayland-rs
ct_path=home/tie/wayland-rs
echo "lxc.mount.entry = /home/tie/wayland-rs home/tie/wayland-rs none bind,create=dir 0 0" | tee -a "/var/lib/lxc/${ct_name}/config"Warning
The ct_path must be relative path.
lxc-stop -n $ct_name
lxc-start -n $ct_name