LoginSignup
0
0

Incus: Almalinux 9 を使う

Last updated at Posted at 2024-02-03

image を探す

incus image list images:alma | grep amd64

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

incus launch images:almalinux/9/amd64 alma9

インストールされたことを確認

$ incus list
+------------+---------+----------------------+------+-----------+-----------+
|    NAME    |  STATE  |         IPV4         | IPV6 |   TYPE    | SNAPSHOTS |
+------------+---------+----------------------+------+-----------+-----------+
| alma9      | RUNNING | 10.56.160.58 (eth0)  |      | CONTAINER | 0         |
+------------+---------+----------------------+------+-----------+-----------+
| alpine319  | RUNNING | 10.56.160.133 (eth0) |      | CONTAINER | 0         |
+------------+---------+----------------------+------+-----------+-----------+
| arch       | RUNNING | 10.56.160.101 (eth0) |      | CONTAINER | 0         |
+------------+---------+----------------------+------+-----------+-----------+
| fedora39   | RUNNING | 10.56.160.21 (eth0)  |      | CONTAINER | 0         |
+------------+---------+----------------------+------+-----------+-----------+
| ubuntu2204 | RUNNING | 10.56.160.209 (eth0) |      | CONTAINER | 0         |
+------------+---------+----------------------+------+-----------+-----------+

root のパスワードを設定

incus exec alma9 bash
$ incus exec alma9 bash
[root@alma9 ~]#

login

incus console alma9
$ incus console alma9
To detach from the console, press: <ctrl>+a q
login: timed out after 60 seconds
AlmaLinux 9.3 (Shamrock Pampas Cat)
Kernel 6.7.3-arch1-1 on an x86_64

alma9 login: 

Login 後の設定

ユーザーの作成

useradd -u 1200 -m -g wheel uchida
groupadd -g 1200 uchida
passwd uchida

sudo のインストール

yum install sudo

sshd のインストール

yum -y install openssh-server
systemctl start sshd

作成したユーザーでログイン

ssh 10.56.160.58

パスワードなしで sudo が実行できるようにする

sudo visudo
(省略)
%wheel ALL=(ALL)    NOPASSWD: ALL
(省略)

パッケージのアップデート

sudo dnf update

タイムゾーンの設定

sudo timedatectl set-timezone Asia/Tokyo

ping を使えるようにする

sudo setcap 'cap_net_raw+p' /bin/ping

確認

$ getcap /bin/ping
/bin/ping cap_net_raw=p
$ ping -c 3 8.8.8.8
PING 8.8.8.8 (8.8.8.8) 56(84) bytes of data.
64 bytes from 8.8.8.8: icmp_seq=1 ttl=114 time=16.6 ms
64 bytes from 8.8.8.8: icmp_seq=2 ttl=114 time=36.0 ms
64 bytes from 8.8.8.8: icmp_seq=3 ttl=114 time=13.4 ms
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