lxd-to-incus 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. #!/bin/bash
  2. curl -fsSL https://pkgs.zabbly.com/key.asc -o /etc/apt/keyrings/zabbly.asc
  3. sh -c 'cat <<EOF > /etc/apt/sources.list.d/zabbly-incus-lts-6.0.sources
  4. Enabled: yes
  5. Types: deb
  6. URIs: https://pkgs.zabbly.com/incus/lts-6.0
  7. Suites: $(. /etc/os-release && echo ${VERSION_CODENAME})
  8. Components: main
  9. Architectures: $(dpkg --print-architecture)
  10. Signed-By: /etc/apt/keyrings/zabbly.asc
  11. EOF'
  12. apt update
  13. apt install incus -y
  14. incus ls
  15. lxd-to-incus --ignore-version-check --yes
  16. incus admin shutdown
  17. systemctl stop incus
  18. systemctl stop incus.socket
  19. systemctl stop incus-user.socket
  20. zfs set mountpoint=/var/lib/incus crypt/lxd/dir
  21. systemctl start incus.socket
  22. systemctl start incus-user.socket
  23. systemctl start incus
  24. cp /root/onstart /root/onstart-backup
  25. rpl 'LXD snap daemon' 'Incus daemons' /root/onstart
  26. rpl '/var/snap/lxd/common/lxd/' '/var/lib/incus/' /root/onstart
  27. sed -i 's/snap disable lxd/systemctl stop incus\nsystemctl stop incus.socket\nsystemctl stop incus-user.socket/' /root/onstart
  28. sed -i 's/snap enable lxd/systemctl start incus-user.socket\nsystemctl start incus.socket\nsystemctl start incus/' /root/onstart
  29. mv /etc/sysctl.d/50-usl-mm.conf /etc/sysctl.d/50-usi-mm.conf