コンテナーのインストール
incus launch images:ubuntu/noble/amd64 ubuntu2404
インストールされたことを確認
$ incus list
+------------+---------+----------------------+-----------------------------------------------+-----------+-----------+
| NAME | STATE | IPV4 | IPV6 | TYPE | SNAPSHOTS |
+------------+---------+----------------------+-----------------------------------------------+-----------+-----------+
| debian12 | RUNNING | 10.158.98.239 (eth0) | fd42:16ef:86e0:dbd7:216:3eff:fe9e:32c (eth0) | CONTAINER | 0 |
+------------+---------+----------------------+-----------------------------------------------+-----------+-----------+
| first | RUNNING | 10.158.98.219 (eth0) | fd42:16ef:86e0:dbd7:216:3eff:fe8f:9dcf (eth0) | CONTAINER | 0 |
+------------+---------+----------------------+-----------------------------------------------+-----------+-----------+
| ubuntu2404 | RUNNING | 10.158.98.56 (eth0) | fd42:16ef:86e0:dbd7:216:3eff:fee7:7975 (eth0) | CONTAINER | 0 |
+------------+---------+----------------------+-----------------------------------------------+-----------+-----------+
root のパスワードを設定
incus exec ubuntu2404 -- bash
$ incus exec ubuntu2404 -- bash
root@ubuntu2404:~#
login
incus console ubuntu2404
$ incus console ubuntu2404
To detach from the console, press: <ctrl>+a q
ubuntu2404 login:
Login 後の設定
ユーザーの作成
adduser --uid 1200 uchida
gpasswd -a uchida sudo
パスワードなしで sudo を実行できるようにする
sudo visudo
(省略)
%sudo ALL=(ALL:ALL) NOPASSWD:ALL
(省略)
sshd のインストール
sudo apt install openssh-server
sshd の設定
/etc/ssh/sshd_config
(省略)
PasswordAuthentication yes
(省略)
タイムゾーンの設定
sudo timedatectl set-timezone Asia/Tokyo
ip アドレスでログイン
$ ssh 10.158.98.56
Welcome to Ubuntu 24.04 LTS (GNU/Linux 6.8.0-35-generic x86_64)
* Documentation: https://help.ubuntu.com
* Management: https://landscape.canonical.com
* Support: https://ubuntu.com/pro
Last login: Tue Jun 4 09:16:23 2024 from 10.158.98.1
uchida@ubuntu2404:~$
avahi-daemon のインストール
sudo apt install avahi-daemon
次のようにログインできるようになります。
ssh ubuntu2404.local