本篇文章更新時間:2025/11/24
如有資訊過時或語誤之處,歡迎使用 Contact 功能通知。
一介資男的 LINE 社群開站囉!歡迎入群聊聊~
如果本站內容對你有幫助,歡迎使用 BFX Pay 加密貨幣 或 新台幣 贊助支持。
使用 Ubuntu 24.04 Server 版本,進入系統後執行下方指令新增套件源。
# mkdir -p /etc/apt/keyrings/
# curl -fsSL https://pkgs.zabbly.com/key.asc -o /etc/apt/keyrings/zabbly.asc
# sh -c 'cat < /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'
處理好套件安裝來源後就是準備開始安裝。
# 安裝主體與介面操作服務
# apt-get install incus incus-ui-canonical -y
# 橋接網路需要用
# apt install openvswitch-switch
安裝完成後執行初始化指令: incus admin init
基本上都先預設沒問題,不過在 Would you like the server to be available over the network? 這問題的時候要注意,如果剛好有服務開在 8443 這 Port 的話,要改一下對應,避免同一個 Port 的佔用導致啟動失敗。
也可以用
incus config set core.https_address :8444這指令改指向別的 port。
隨後連線到 https://IP_ADDRESS:PORT 指定的 Port 號下來操作,預設就是照指示去授權你的電腦,完成後即可開始使用。
要注意的是如果需要橋接機器上的網卡,拿到跟 Host 同層的 IP 網路位置需要做一些 Host 上的調整。
# 先確認沒有建立 br0 介面卡
# incus network list
# 建立 br0 的介面卡
# incus network create br0
# 確認 /etc/netplan/ 目錄下的 yaml 設定檔案,新增 bridges 的設定,範例:
network:
version: 2
ethernets:
enp2s0:
dhcp4: true
bridges:
br0:
interfaces: [enp2s0]
dhcp4: true
# 套用設定
# netplan try
改了這段後,要記得如果 Homelab 中有使用到 ddclient 服務同步 IP,要改成 br0 介面。(
/etc/ddclient.conf)
接著編輯 Incus 的 default Profile 設定
# 移除預設的 eth0
# incus profile device remove default eth0
# 新增 eth0 網路卡指向 br0
# incus profile device add default eth0 nic network=br0 name=eth0
開一個 VM 的方法:
# incus launch images:debian/12 VM_NAME --vm
# incus config set VM_NAME limits.cpu=2
# incus config set VM_NAME limits.memory=4GB
# incus start VM_NAME
