1
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?

Proxmox VE 9.2を自分流にセットアップ

1
Last updated at Posted at 2026-06-19

環境

Proxmox VE 9.2
FUJITSU Server PRIMERGY RX2530 M4
・Intel Xeon Gold 6134 * 2
・16GB DRAM * 2
・750GB HDD * 1
および
・Intel Xeon Gold 5118 * 2
・16GB DRAM * 2
・750GB HDD * 1
インストールのステップは省略します。(キャプボがなく体裁を整えたものがお出しできないため)

入れ子になった仮想化が有効化チェック

シェルを開いて以下を実行します。

# cat /sys/module/kvm_intel/parameters/nested

応答がYか1ならOK。
Nか0ならIntelの場合は

# echo "options kvm-intel nested=1" | sudo tee /etc/modprobe.d/kvm-intel.conf
# modprobe -r kvm-intel

参考用: AMDの場合は

# echo "options kvm-amd nested=1" | sudo tee /etc/modprobe.d/kvm-amd.conf
# modprobe -r kvm-amd

を実行します。

アップデート

左ペイン データセンター > pvw > アップデート > リポジトリから「追加」 > 「No-Subscription」を選択します。
image.png
enterpriseと名のつく2つのProxmoxリポジトリを無効化します。
image.png
終わったら「アップデート」に移動して「再表示」します。
image.png
更新可能パッケージの列挙が終わったら「アップグレード」します。
image.png

vimの設定

Nanoよりはvimの方がいいがカーソルキーとバックスペースは使いたいので以下の設定をします。
「pve」 > シェルを開いて以下を実行します。

# echo set nocompatible  > ~/.vimrc
# echo set backspace=indent,eol,start >> ~/.vimrc
# update-alternatives --config editor
There are 2 choices for the alternative editor (providing /usr/bin/editor).

  Selection    Path               Priority   Status
------------------------------------------------------------
* 0            /bin/nano           40        auto mode
  1            /bin/nano           40        manual mode
  2            /usr/bin/vim.tiny   15        manual mode

Press <enter> to keep the current choice[*], or type selection number: 2
update-alternatives: using /usr/bin/vim.tiny to provide /usr/bin/editor (editor) in manual mode

RPC、SPICE Proxyの無効化

NFSは使用しないので、RPCを無効化します。
SPICE Proxyも使用しないので無効化します。

# systemctl disable rpcbind.socket
# systemctl disable rpcbind.service
# systemctl disable spiceproxy
# systemctl stop rpcbind.target
# systemctl stop rpcbind.socket
# systemctl stop rpcbind.service
# systemctl stop spiceproxy

シェルの日本語化

# sed -i -E 's/# (ja_JP.UTF-8)/\1/' /etc/locale.gen
# locale-gen
# update-locale LANG=ja_JP.UTF-8

Journalからテキストログへ

Proxmox VEではsyslogはjournaldで管理されますが、RHEL系同様のログ管理をしたいので次のようにします。

/etc/rsyslog.conf
# rsyslog configuration file

# For more information see /usr/share/doc/rsyslog-*/rsyslog_conf.html
# or latest version online at http://www.rsyslog.com/doc/rsyslog_conf.html 
# If you experience problems, see http://www.rsyslog.com/doc/troubleshoot.html

#### GLOBAL DIRECTIVES ####

# Where to place auxiliary files
global(workDirectory="/var/lib/rsyslog")

#### MODULES ####

# Use default timestamp format
module(load="builtin:omfile" Template="RSYSLOG_TraditionalFileFormat")

module(load="imuxsock"    # provides support for local system logging (e.g. via logger command)
       SysSock.Use="off") # Turn off message reception via local log socket; 
                          # local messages are retrieved through imjournal now.
module(load="imjournal"             # provides access to the systemd journal
       UsePid="system" # PID nummber is retrieved as the ID of the process the journal entry originates from
       FileCreateMode="0644" # Set the access permissions for the state file
       StateFile="imjournal.state") # File to store the position in the journal

# Include all config files in /etc/rsyslog.d/
include(file="/etc/rsyslog.d/*.conf" mode="optional")

#module(load="imklog") # reads kernel messages (the same are read from journald)
#module(load="immark") # provides --MARK-- message capability

# Provides UDP syslog reception
# for parameters see http://www.rsyslog.com/doc/imudp.html
#module(load="imudp") # needs to be done just once
#input(type="imudp" port="514")

# Provides TCP syslog reception
# for parameters see http://www.rsyslog.com/doc/imtcp.html
#module(load="imtcp") # needs to be done just once
#input(type="imtcp" port="514")

#### RULES ####

# Log all kernel messages to the console.
# Logging much else clutters up the screen.
#kern.*                                                 /dev/console

# Log anything (except mail) of level info or higher.
# Don't log private authentication messages!
*.info;mail.none;authpriv.none;cron.none                /var/log/messages

# The authpriv file has restricted access.
authpriv.*                                              /var/log/secure

# Log all the mail messages in one place.
mail.*                                                  -/var/log/maillog

# Log cron stuff
cron.*                                                  /var/log/cron

# Everybody gets emergency messages
*.emerg                                                 :omusrmsg:*

# Save news errors of level crit and higher in a special file.
uucp,news.crit                                          /var/log/spooler

# ### sample forwarding rule ###
#action(type="omfwd"  
# # An on-disk queue is created for this action. If the remote host is
# # down, messages are spooled to disk and sent when it is up again.
#queue.filename="fwdRule1"       # unique name prefix for spool files
#queue.maxdiskspace="1g"         # 1gb space limit (use as much as possible)
#queue.saveonshutdown="on"       # save messages to disk on shutdown
#queue.type="LinkedList"         # run asynchronously
#action.resumeRetryCount="-1"    # infinite retries if host is down
# # Remote Logging (we use TCP for reliable delivery)
# # remote_host is: name/ip, e.g. 192.168.0.1, port optional e.g. 10514
#Target="remote_host" Port="XXX" Protocol="tcp")

/etc/rsyslog.confを残すようにNを応答します。

# apt install rsyslog

ローテートの対象を変更します。

/etc/logrotate.d/rsyslog
/var/log/cron
/var/log/maillog
/var/log/messages
/var/log/secure
/var/log/spooler
{
    missingok
    sharedscripts
    postrotate
        /usr/bin/systemctl reload rsyslog.service >/dev/null 2>&1 || true
    endscript
}

ローテート日をファイル名のサフィックスとするようにします。

/etc/logrotate.conf
# see "man logrotate" for details

# global options do not affect preceding include directives

# rotate log files weekly
weekly

# keep 4 weeks worth of backlogs
rotate 4

# create new (empty) log files after rotating old ones
create

# use date as a suffix of the rotated file
- #dateext
+ dateext

# uncomment this if you want your log files compressed
#compress

# packages drop log rotation information into this directory
include /etc/logrotate.d

# system-specific logs may also be configured here.

蛇足? ユーザーの設定

素のPVEにはsudoが入っていないのでインストールします。

# apt install sudo

ユーザーを追加します。

# useradd -m admin -g sudo -s /bin/bash
# passwd admin
新しいパスワード: 
新しいパスワードを再入力してください: 
passwd: パスワードは正しく更新されました

設定したユーザーと同名のユーザーをPVE側でも定義します。
PVE側でパスワードを設定する必要はありません。
image.png
アクセス権限の設定にて適切な権限を与えます。ここでは大雑把に最大権限を与えてしまっています。
image.png
root@pamユーザーと必要に応じて他のユーザーにMFAを設定しておきます。admin@pamにも設定するべきでしょう。
スクリーンショット 2026-06-18 234609.png
rootユーザーのパスワードログインを禁止にします。
PVEではクラスタを構成する場合rootユーザーでのSSHログインが必須になるため、PermitRootLogin noではいけません。

/etc/ssh/sshd_config
PermitRootLogin prohibit-password

ベストプラクティスとしては追加したユーザーにも公開鍵認証を実装し、

/etc/ssh/sshd_config
PasswordAuthentication no

とするべきでしょう。

sshdを再起動します。

# systemctl restart sshd

証明書の入れ替え

ローカルCAサーバーにて証明書を作成します。

/tmp/keyUsage
basicConstraints = CA:false
keyUsage = critical, digitalSignature, keyEncipherment
extendedKeyUsage = serverAuth
authorityKeyIdentifier=keyid,issuer
subjectAltName = DNS:<hostname>.sayakek.internal
$ sudo sudo openssl ecparam -genkey -name secp384r1 -out <hostname>_secret.pem
$ sudo openssl req -new -key <hostname>_secret.pem -out <hostname>request.csr
$ sudo openssl x509 -req -in <hostname>request.csr -CA /etc/ssl/private/ca_cert.crt -CAkey /etc/ssl/private/ca_priv.pem -out <hostname>_certificate.crt -extfile /tmp/keyUsage -days 3650 -sha256
$ sudo rm <hostname>request.csr
$ rm /tmp/keyUsage

作成した秘密鍵から

-----BEGIN EC PARAMETERS-----
<EC PARAMETERS>
-----END EC PARAMETERS-----

の部分を取り除きます。
秘密鍵と証明書のペアをアップロードします。
スクリーンショット 2026-06-19 132044.png
問題なく動作しました。
スクリーンショット 2026-06-19 132816.png

参考文献

1
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
1
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?