インスタンスの作成時にブートディスクとしてUbuntu 20.04 TLSを使用。 可用性ポリシーからプリエンプティブをオンにするとかなり金額を低くできる(ただし24時間以内に必ずシャットダウンされるようになる)
sudo localectl set-locale LANG=ja_JP.UTF-8 LANGUAGE="ja_JP:ja"
sudo locale-gen --purge "ja_JP.UTF-8"
sudo dpkg-reconfigure --frontend noninteractive locales
sudo ln -fs /usr/share/zoneinfo/Asia/Tokyo /etc/localtime
sudo dpkg-reconfigure --frontend noninteractive tzdata
参考 https://help.ubuntu.com/community/InstallingKDE
sudo apt update
sudo apt -y upgrade
sudo apt install aptitude
sudo aptitude install kde-plasma-desktop fcitx-mozc
$sudo nano /etc/polkit-1/localauthority/50-local.d/org.freedesktop.color-manager.pkla
[ColorManager]
Identity=unix-user:*
Action=org.freedesktop.color-manager.*
ResultAny=yes
ResultInactive=yes
ResultActive=yes
$sudo nano /etc/polkit-1/localauthority/50-local.d/org.freedesktop.NetworkManager.pkla
[NetworkManager]
Identity=unix-user:*
Action=org.freedesktop.NetworkManager.*
ResultAny=yes
ResultInactive=yes
ResultActive=yes
$sudo ufw limit ssh
$sudo ufw enable
$sudo reboot
とりあえず2GBで設定
sudo dd if=/dev/zero of=/swap bs=2M count=1024
sudo chmod 0600 /swap
sudo mkswap /swap
sudo swapon /swap
echo "/swap none swap sw 0 0" | sudo tee -a /etc/fstab
wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
sudo apt -y install ./google-chrome-stable_current_amd64.deb
SSHからのセットアップ https://remotedesktop.google.com/headless?hl=ja
wget https://dl.google.com/linux/direct/chrome-remote-desktop_current_amd64.deb
sudo apt -y install ./chrome-remote-desktop_current_amd64.deb
追加で、Chrome Remote Desktopを使うときにXセッションの選択が毎回出てきて煩わしいのでXsessionを固定する
echo "exec /etc/X11/Xsession /usr/bin/startplasma-x11" | sudo tee -a /etc/chrome-remote-desktop-session
デスクトップ操作中にパスワードを聞かれた場合、ubuntuユーザーのパスワードを入れる必要がある
sudo passwd ubuntu
- キーボードがUSになっているのでJapaneseを追加
- スクリーンロックの設定を外す