0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

Incus: Ubuntu 24.04 を使う

Last updated at Posted at 2024-02-02

コンテナーのインストール

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
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?