経緯
自宅のサーバ環境に外出先から接続したいことがあります。 無償で利用可能なTailscaleを使っています。 Ubuntu 26.04 LTSがリリースされたので、Proxmox VE上のLXCコンテナとして実行環境を構築する記録を残します。
前提条件
- Tailscaleのアカウントは作成済み
- Proxmox Kernel Version: Linux 7.0.0-3-pve (2026-04-21T22:56Z)
- 各種コマンドは特権で実行
LXCテンプレートのダウンロード
Proxmox VEが提供する基本テンプレートを利用します。利用可能なテンプレートリストは1日1回バックグラウンドで更新されていますが、手動で更新しておきます。
:~# pveam updateupdate successfulベースOSの入ったテンプレートの一覧は下記のコマンドで確認可能です。
:~# pveam available --section systemsystem almalinux-10-default_20250930_amd64.tar.xzsystem almalinux-9-default_20240911_amd64.tar.xzsystem alpine-3.22-default_20250617_amd64.tar.xzsystem alpine-3.23-default_20260116_amd64.tar.xzsystem archlinux-base_20260420-1_amd64.tar.zstsystem centos-9-stream-default_20240828_amd64.tar.xzsystem debian-12-standard_12.12-1_amd64.tar.zstsystem debian-13-standard_13.1-2_amd64.tar.zstsystem devuan-5.0-standard_5.0_amd64.tar.gzsystem fedora-42-default_20250428_amd64.tar.xzsystem fedora-43-default_20260115_amd64.tar.xzsystem gentoo-current-openrc_20250508_amd64.tar.xzsystem openeuler-25.03-default_20250507_amd64.tar.xzsystem opensuse-15.6-default_20240910_amd64.tar.xzsystem opensuse-16.0-default_20260116_amd64.tar.xzsystem rockylinux-10-default_20251001_amd64.tar.xzsystem rockylinux-9-default_20240912_amd64.tar.xzsystem ubuntu-22.04-standard_22.04-1_amd64.tar.zstsystem ubuntu-24.04-standard_24.04-2_amd64.tar.zstsystem ubuntu-25.04-standard_25.04-1.1_amd64.tar.zstsystem ubuntu-26.04-standard_26.04-1_amd64.tar.zst今回はUbuntu 26.04を利用します。tailscaleだけを動かすのであれば、より軽量なイメージを選択するのもよいですが、稼働後の運用を考えると普段使い慣れたOSが良いかと思います。
上記テンプレートの一覧からイメージを選択しダウンロードします。以下のコマンドでダウンロードすることで、テンプレートフォルダーにイメージを配置してくれます。
:~# pveam download local ubuntu-26.04-standard_26.04-1_amd64.tar.zstdownloading http://download.proxmox.com/images/system/ubuntu-26.04-standard_26.04-1_amd64.tar.zst to /var/lib/vz/template/cache/ubuntu-26.04-standard_26.04-1_amd64.tar.zst--2026-05-04 11:35:51-- http://download.proxmox.com/images/system/ubuntu-26.04-standard_26.04-1_amd64.tar.zstResolving download.proxmox.com (download.proxmox.com)... 51.91.38.34, 2001:41d0:b00:5900::34Connecting to download.proxmox.com (download.proxmox.com)|51.91.38.34|:80... connected.HTTP request sent, awaiting response... 200 OKLength: 158434587 (151M) [application/octet-stream]Saving to: '/var/lib/vz/template/cache/ubuntu-26.04-standard_26.04-1_amd64.tar.zst.tmp_dwnl.1825' 0K ........ ........ ........ ........ 21% 922K 2m12s32768K ........ ........ ........ ........ 42% 357K 2m53s65536K ........ ........ ........ ........ 63% 484K 1m52s98304K ........ ........ ........ ........ 84% 367K 51s131072K ........ ........ ....... 100% 349K=5m52s2026-05-04 11:41:44 (439 KB/s) - '/var/lib/vz/template/cache/ubuntu-26.04-standard_26.04-1_amd64.tar.zst.tmp_dwnl.1825' saved [158434587/158434587]calculating checksum...OK, checksum verifieddownload of 'http://download.proxmox.com/images/system/ubuntu-26.04-standard_26.04-1_amd64.tar.zst' to '/var/lib/vz/template/cache/ubuntu-26.04-standard_26.04-1_amd64.tar.zst' finishedこれで準備はととのいました。なお、イメージのダウンロードはWEB GUIからも実行可能です。
LXCコンテナの作成
CTを作成からコンテナを作成します。
テンプレートは先程ダウンロードしたテンプレートを指定します。
リソースは初期設定のまま与えましたが、流石にディスクリソース8GBは足りなかったかもしれません。 ディスクを使うときはパッケージのUpdate時だと思うので、不足を感じたときは増やしたいと思います。

起動前に、Proxmox側でコンテナの設定ファイルを変更します。これはコンテナがTUNデバイスを使用するために必要な設定です。
confのファイル名はコンテナ作成時にProxmoxで指定したCT IDに一致します。
:~# vim /etc/pve/lxc/102.conf末尾に以下の設定を追記します。
lxc.cgroup2.devices.allow: c 10:200 rwmlxc.mount.entry: /dev/net/tun dev/net/tun none bind,create=file:~# cat /etc/pve/lxc/102.confarch: amd64cores: 1features: nesting=1hostname: tailscale26.04memory: 512net0: name=eth0,bridge=vmbr0,firewall=1,hwaddr=BC:24:11:F6:7C:69,ip=dhcp,type=vethostype: ubunturootfs: local-lvm:vm-102-disk-0,size=8Gswap: 512unprivileged: 1lxc.cgroup2.devices.allow: c 10:200 rwmlxc.mount.entry: /dev/net/tun dev/net/tun none bind,create=file設定が終わったらコンテナを起動し、問題なく起動するか確認します。
コンテナ内での設定
まずはSSHできないと不便なので一般ユーザを作成します。
:~# adduser usernameSSH接続後rootに昇格しUpdateします。
:~$ su -Password::~# apt update:~# apt upgradeサブネットルーターとして動作させるため、IP Forwardingを有効化します。
:~# apt install vim:~# vim /etc/sysctl.d/99-tailscale.conf以下の内容を記述しますが、IPv4のみ利用する場合はIPv6行の記述は不要です。
net.ipv4.ip_forward = 1net.ipv6.conf.all.forwarding = 1:~# cat /etc/sysctl.d/99-tailscale.confnet.ipv4.ip_forward = 1net.ipv6.conf.all.forwarding = 1設定が完了したら適用します。
:~# sysctl -p /etc/sysctl.d/99-tailscale.confnet.ipv4.ip_forward = 1net.ipv6.conf.all.forwarding = 1Tailscaleのインストール
Tailscaleをインストールします。
:~# apt install curl:~# curl -fsSL https://tailscale.com/install.sh | shInstalling Tailscale for ubuntu resolute, using method apt+ mkdir -p --mode=0755 /usr/share/keyrings+ curl -fsSL https://pkgs.tailscale.com/stable/ubuntu/resolute.noarmor.gpg+ tee /usr/share/keyrings/tailscale-archive-keyring.gpg+ chmod 0644 /usr/share/keyrings/tailscale-archive-keyring.gpg+ curl -fsSL https://pkgs.tailscale.com/stable/ubuntu/resolute.tailscale-keyring.list+ tee /etc/apt/sources.list.d/tailscale.list# Tailscale packages for ubuntu resolutedeb [signed-by=/usr/share/keyrings/tailscale-archive-keyring.gpg] https://pkgs.tailscale.com/stable/ubuntu resolute main+ chmod 0644 /etc/apt/sources.list.d/tailscale.list+ apt-get updateGet:1 https://pkgs.tailscale.com/stable/ubuntu resolute InReleaseGet:2 https://pkgs.tailscale.com/stable/ubuntu resolute/main all Packages [354 B]Get:3 https://pkgs.tailscale.com/stable/ubuntu resolute/main amd64 Packages [14.7 kB]Hit:4 http://archive.ubuntu.com/ubuntu resolute InReleaseHit:5 http://archive.ubuntu.com/ubuntu resolute-updates InReleaseHit:6 http://archive.ubuntu.com/ubuntu resolute-security InReleaseFetched 21.7 kB in 2s (10.3 kB/s)Reading package lists... Done+ [ -n ]+ apt-get install -y tailscale tailscale-archive-keyringReading package lists... DoneBuilding dependency tree... DoneReading state information... DoneSolving dependencies... DoneThe following NEW packages will be installed: tailscale tailscale-archive-keyring0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded.Need to get 36.6 MB of archives.After this operation, 71.9 MB of additional disk space will be used.Get:1 https://pkgs.tailscale.com/stable/ubuntu resolute/main amd64 tailscale amd64 1.96.4 [36.6 MB]Get:2 https://pkgs.tailscale.com/stable/ubuntu resolute/main all tailscale-archive-keyring all 1.35.181 [3082 B]Fetched 36.6 MB in 1s (28.4 MB/s)Selecting previously unselected package tailscale.(Reading database ... 24457 files and directories currently installed.)Preparing to unpack .../tailscale_1.96.4_amd64.deb ...Unpacking tailscale (1.96.4) ...Selecting previously unselected package tailscale-archive-keyring.Preparing to unpack .../tailscale-archive-keyring_1.35.181_all.deb ...Unpacking tailscale-archive-keyring (1.35.181) ...Setting up tailscale-archive-keyring (1.35.181) ...Setting up tailscale (1.96.4) ...Created symlink '/etc/systemd/system/multi-user.target.wants/tailscaled.service' → '/usr/lib/systemd/system/tailscaled.service'.+ [ false = true ]+ set +xInstallation complete! Log in to start using Tailscale by running:
tailscale up後は起動、認証を通します。その後経路情報を広報します。
:~# tailscale up
To authenticate, visit:
https://login.tailscale.com/a/xxxxxxxxxxxx
Success.:~# tailscale set --advertise-routes=10.3.0.0/24,10.3.4.0/24Tailscaleの WEB Console で該当の経路広報にチェックを入れ有効化したら完了です。
