〇gretlの画面
TigerVNCがインストールされているので、VNCクライアントで接続することができます。VNCパスワードはvagrantです。
構築方法
以下のVagrantfileを使用して、gretl、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 = "ub1804vncxfcegretl"
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 = "ub1804vncxfcegretl"
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 gretl
apt-get -y install gretl
init 5
SHELL
end
0 件のコメント:
コメントを投稿