DEV Community

Cover image for Install Incus in WSL2
hardyweb
hardyweb

Posted on • Updated on

Install Incus in WSL2

Nape Incus nim ? ia merupakang fork LXD - linux Container. memandangkang pembangunang lxd telah diambil balik oleh Pihok Connicel Ubuntu, makanya saknim, sep-sep Linux Container pong Fork ahh lxd, jadi tubik lah hok baru nama dia Incus. jadi nota hok ambe tulis nim, ambe test dalam WSL2, guna debian 12 deh. soh beng tanya ahh linux lain.. amber dok test.

Mula-mula skali, kena update wsl dulu. Dalang PowerShell, taip

wsl --update
Enter fullscreen mode Exit fullscreen mode

lepas tu buka WSL2 Image - sedia ada, misalnya debian, enablekang systemd

cd /etc
touch wsl.conf 
vi wsl.conf
Enter fullscreen mode Exit fullscreen mode

Tulis sebagaimana di bawoh.

[boot]
systemd=true
Enter fullscreen mode Exit fullscreen mode

lepah tu, restart wsl , guna powershell neh

wsl --shutdown
Enter fullscreen mode Exit fullscreen mode

pah tu gok, kita install lah incus tu

curl -fsSL https://pkgs.zabbly.com/key.asc | gpg --show-keys --fingerprint
Enter fullscreen mode Exit fullscreen mode

mesti nampok key zabbly sebagaimana di bawoh

pub   rsa3072 2023-08-23 [SC] [expires: 2025-08-22]
      4EFC 5906 96CB 15B8 7C73  A3AD 82CC 8797 C838 DCFD
uid                      Zabbly Kernel Builds <info@zabbly.com>
sub   rsa3072 2023-08-23 [E] [expires: 2025-08-22]
Enter fullscreen mode Exit fullscreen mode

pahtu deme save key tu guna arahan di bawoh.

curl -fsSL https://pkgs.zabbly.com/key.asc -o /etc/apt/keyrings/zabbly.asc
Enter fullscreen mode Exit fullscreen mode

pahtu run arahan tu dalam root atau sudo

sh -c 'cat <<EOF > /etc/apt/sources.list.d/zabbly-incus-stable.sources
Enabled: yes
Types: deb
URIs: https://pkgs.zabbly.com/incus/stable
Suites: $(. /etc/os-release && echo ${VERSION_CODENAME})
Components: main
Architectures: $(dpkg --print-architecture)
Signed-By: /etc/apt/keyrings/zabbly.asc

EOF'
Enter fullscreen mode Exit fullscreen mode
apt-get update
Enter fullscreen mode Exit fullscreen mode
apt install incus 
Enter fullscreen mode Exit fullscreen mode

bila sudoh siap install incus tu, deme check systemd incus

sudo systemctl status incus 
Enter fullscreen mode Exit fullscreen mode

kalu ada, enable kan dia

sudo systemctl enable incus 
Enter fullscreen mode Exit fullscreen mode
sudo systemctl start incus 
Enter fullscreen mode Exit fullscreen mode

tapi kalu nok molek, deme restart wsl skali guna powershell.

pastu deme set supaya dok payah tulis sudo sudo doh bila nok run incus. sudo apa kerek kerek..

sudo adduser YOUR-USERNAME incus-admin
newgrp incus-admin
Enter fullscreen mode Exit fullscreen mode
incus admin init --minimal
Enter fullscreen mode Exit fullscreen mode

pah tu boleh la nok main dengan container pun, kasi test create container satu kali.

incus launch images:alpine/edge alpine
incus exec alpine sh

Enter fullscreen mode Exit fullscreen mode

kalu boleh masuk ke alpine tu, kira jadi doh tu .

ni untuk tengok berapa kontainer ada dalam incus.

incus list 
Enter fullscreen mode Exit fullscreen mode

rujukang

  1. https://linuxcontainers.org/incus/docs/main/installing/
  2. https://github.com/zabbly/incus
  3. https://wsl.dev/wsl2-lxd-funtoo/

Top comments (0)