〇Gantt Projectの画面
TigerVNCがインストールされているので、VNCクライアントで接続することができます。VNCパスワードはvagrantです。
〇構築方法
以下のVagrantfileを使用して、Gantt Project、Xfce Desktop環境、TigerVNCをインストールした仮想マシン(Ubuntu18.04) を構築できます。
Vagrantfile
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.box = "bento/ubuntu-18.04"
config.vm.hostname = "ub1804vncxfceganttproject"
config.vm.network :public_network, ip:"192.168.1.108"
config.vm.network "private_network", ip: "192.168.55.108", :netmask => "255.255.255.0"
config.vm.provider :virtualbox do |vbox|
vbox.name = "ub1804vncxfceganttproject"
vbox.gui = true
vbox.cpus = 2
vbox.memory = 2048
end
config.vm.provision "shell", inline: <<-SHELL
apt-get update
export DEBIAN_FRONTEND=noninteractive
apt-get -y -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold" upgrade
apt-get -y install language-pack-ja fonts-ipafont-*
localectl set-locale LANG=ja_JP.UTF-8
localectl set-keymap jp106
apt-get update
apt-get -y install fcitx-mozc xubuntu-desktop xfce4-terminal language-pack-ja tigervnc-standalone-server expect
apt-get -y purge light-locker blueman
im-config -n fcitx
# set passwd for vnc
cat << EOC > /tmp/initpass.sh
/usr/bin/expect << EOF
spawn "tigervncpasswd"
expect "Password:"
send "vagrant\\r"
expect "Verify:"
send "vagrant\\r"
expect "Would you like to enter a view-only password (y/n)?"
send "n\\r"
expect eof
exit
EOF
EOC
chmod +x /tmp/initpass.sh
sudo -u vagrant -H /bin/bash -c "/tmp/initpass.sh"
mkdir -p /home/vagrant/.vnc
chown vagrant:vagrant /home/vagrant/.vnc
cat << EOF > /home/vagrant/.vnc/xstartup
#!/bin/sh
export LANG=ja_JP.UTF-8
export LC_ALL=ja_JP.UTF-8
export XMODIFIERS=@im=fcitx
export GTK_IM_MODULE=fcitx
fcitx -r -d &
exec startxfce4
EOF
chmod +x /home/vagrant/.vnc/xstartup
cat << EOF > /etc/systemd/system/vncserver@.service
[Unit]
Description=Remote desktop service (VNC)
After=syslog.target network.target
[Service]
Type=simple
User=vagrant
PAMName=login
PIDFile=/home/%u/.vnc/%H%i.pid
ExecStartPre=/bin/sh -c '/usr/bin/vncserver -kill :%i > /dev/null 2>&1 || :'
ExecStart=/usr/bin/vncserver :%i -localhost no -geometry 1152x864 -alwaysshared -fg
ExecStop=/usr/bin/vncserver -kill :%i
[Install]
WantedBy=multi-user.target
EOF
sudo systemctl start vncserver@1.service
sudo systemctl enable vncserver@1.service
# install AdoptOpenJDK11
cd /opt
wget https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk-11.0.3%2B7/OpenJDK11U-jdk_x64_linux_hotspot_11.0.3_7.tar.gz
tar xvfz OpenJDK11U-jdk_x64_linux_hotspot_11.0.3_7.tar.gz
cat << EOF > /etc/profile.d/jdk.sh
export JAVA_HOME=/opt/jdk-11.0.3+7
export PATH=\\$PATH:\\$JAVA_HOME/bin
EOF
update-alternatives --install /usr/bin/java java /opt/jdk-11.0.3+7/bin/java 2000
update-alternatives --install /usr/bin/javac javac /opt/jdk-11.0.3+7/b/javac 2000
# install GanttProject
apt-get -y install unzip
cd /opt
wget -O ganttproject-2.8.10-r2364.zip https://www.ganttproject.biz/dl/2.8.10/any
unzip ganttproject-2.8.10-r2364.zip
cat << EOF > /usr/share/applications/ganttproject.desktop
[Desktop Entry]
Version=1.0
Type=Application
Terminal=false
Exec=/opt/ganttproject-2.8.10-r2364/ganttproject
Name=Gantt Project
Categories=Development;
EOF
init 5
SHELL
end
0 件のコメント:
コメントを投稿