Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Cloud9にリモートデスクトップ接続する

ryome
April 24, 2023

 Cloud9にリモートデスクトップ接続する

ryome

April 24, 2023
Tweet

More Decks by ryome

Other Decks in Technology

Transcript

  1. $ lsblk NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT loop0

    7:0 0 49.9M 1 loop /snap/snapd/18596 loop1 7:1 0 55.6M 1 loop /snap/core18/2721 loop2 7:2 0 24.4M 1 loop /snap/amazon-ssm-agent/6312 xvda 202:0 0 15G 0 disk ├─xvda1 202:1 0 9.9G 0 part / ├─xvda14 202:14 0 4M 0 part └─xvda15 202:15 0 106M 0 part /boot/efi $ sudo growpart /dev/xvda 1 CHANGED: partition=1 start=227328 old: size=20744159 end=20971487 new: size=31229919,end=31457247 $ lsblk NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT loop0 7:0 0 49.9M 1 loop /snap/snapd/18596 loop1 7:1 0 55.6M 1 loop /snap/core18/2721 loop2 7:2 0 24.4M 1 loop /snap/amazon-ssm-agent/6312 xvda 202:0 0 15G 0 disk ├─xvda1 202:1 0 14.9G 0 part / ├─xvda14 202:14 0 4M 0 part └─xvda15 202:15 0 106M 0 part /boot/efi パーティションを拡張
  2. $ df -h Filesystem Size Used Avail Use% Mounted on

    udev 473M 0 473M 0% /dev tmpfs 98M 832K 97M 1% /run /dev/xvda1 9.6G 5.6G 4.0G 59% / tmpfs 488M 0 488M 0% /dev/shm tmpfs 5.0M 0 5.0M 0% /run/lock tmpfs 488M 0 488M 0% /sys/fs/cgroup /dev/loop0 50M 50M 0 100% /snap/snapd/18596 /dev/loop2 25M 25M 0 100% /snap/amazon-ssm-agent/6312 /dev/loop1 56M 56M 0 100% /snap/core18/2721 /dev/xvda15 105M 5.2M 100M 5% /boot/efi tmpfs 98M 0 98M 0% /run/user/1000 $ sudo resize2fs /dev/xvda1 resize2fs 1.44.1 (24-Mar-2018) Filesystem at /dev/xvda1 is mounted on /; on-line resizing required old_desc_blocks = 2, new_desc_blocks = 2 The filesystem on /dev/xvda1 is now 3903739 (4k) blocks long. $ df -h Filesystem Size Used Avail Use% Mounted on udev 473M 0 473M 0% /dev tmpfs 98M 832K 97M 1% /run /dev/xvda1 15G 5.6G 8.8G 39% / tmpfs 488M 0 488M 0% /dev/shm tmpfs 5.0M 0 5.0M 0% /run/lock tmpfs 488M 0 488M 0% /sys/fs/cgroup /dev/loop0 50M 50M 0 100% /snap/snapd/18596 /dev/loop2 25M 25M 0 100% /snap/amazon-ssm-agent/6312 /dev/loop1 56M 56M 0 100% /snap/core18/2721 /dev/xvda15 105M 5.2M 100M 5% /boot/efi tmpfs 98M 0 98M 0% /run/user/1000 パーティションを拡張
  3. $ sudo apt install ubuntu-mate-desktop ...省略 $ sudo apt install

    vnc4server ...省略 Ubuntu Mate Desktop と vnc4server をインストール
  4. $ vncserver :1 You will require a password to access

    your desktops. Password: Verify: xauth: file /home/ubuntu/.Xauthority does not exist New 'ip-172-31-11-97:1 (ubuntu)' desktop is ip-172-31-11- 97:1 Creating default startup script /home/ubuntu/.vnc/xstartup Starting applications specified in /home/ubuntu/.vnc/xstartup Log file is /home/ubuntu/.vnc/ip-172-31-11-97:1.log VNCサーバのパスワード 設定
  5. $ cat /home/ubuntu/.vnc/xstartup #!/bin/sh # Uncomment the following two lines

    for normal desktop: # unset SESSION_MANAGER # exec /etc/X11/xinit/xinitrc unset DBUS_SESSION_BUS_ADDRESS export XMODIFIERS="@im=fcitx" fcitx [ -x /etc/vnc/xstartup ] && exec /etc/vnc/xstartup [ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources xsetroot -solid grey # vncconfig -iconic & # x-terminal-emulator -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" & # x-window-manager & mate-session & VNCサーバ設定ファイル を修正
  6. $ sudo passwd ubuntu Enter new UNIX password: Retype new

    UNIX password: passwd: password updated successfully Ubuntuの パスワード設定
  7. ssh -L 8888:localhost:5901 [email protected] ...省略 [email protected]'s password: ...省略 *** System

    restart required *** A VNC server is already running as :1 :~ $ クライアント端末で SSH接続