2019年3月23日土曜日

VagrantでBlender、Xfce Desktop環境、XRDPがインストールされた仮想マシン(Debian Stretch/9.6)を構築する

Blenderはオープンソースの3D CG作成ソフトウェアです。

〇Blenderの画面


〇構築方法
以下のVagrantfileを使用して、Blender、Xfce Desktop環境、XRDPをインストールした仮想マシン(Debian Stretch/9.6)を構築できます。
XRDPがインストールされているので、Windowsのリモートデスクトップで接続することができます。ユーザ名はvagrant、パスワードもvagrantでログオンできます。

Vagrantfile
VAGRANTFILE_API_VERSION = "2"

Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
  config.vm.box = "bento/debian-9.6"
  config.vm.hostname = "db96xfceblender"
config.vm.network "public_network", ip:"192.168.1.109", :netmask => "255.255.255.0"
  config.vm.provider :virtualbox do |vbox|
     vbox.name = "db96xfceblender"
     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 task-japanese gawk
sed -i -e 's/# ja_JP.UTF-8 UTF-8/ja_JP.UTF-8 UTF-8/' /etc/locale.gen
locale-gen
update-locale LANG=ja_JP.UTF-8
localectl set-locale LANG=ja_JP.UTF-8
localectl set-keymap jp106
apt-get update
cat << EOF > /etc/default/keyboard
XKBMODEL="pc106"
XKBLAYOUT="jp"
XKBVARIANT=""
XKBOPTIONS=""
BACKSPACE="guess"
EOF

cat << EOF > /home/vagrant/.xsessionrc
export GTK_IM_MODULE=fcitx
export QT_IM_MODULE=fcitx
export XMODIFIERS="@im=fcitx"
sed -i -e "s/^EnabledIMList.*$/EnabledIMList=fcitx-keyboard-jp:True,mozc:True,fcitx-keyboard-us:False/" /home/vagrant/.config/fcitx/profile
fcitx-remote -r
fcitx -r -d
#startxfce4 &
EOF
chown vagrant:vagrant .xsessionrc

apt-get -y install  xrdp fcitx-mozc task-xfce-desktop tigervnc-standalone-server
im-config -n fcitx
sudo -u vagrant bash -i -c "export DISPLAY=:0.0 && fcitx -r"

cp /etc/xrdp/xrdp.ini /etc/xrdp/xrdp.ini.org
cat /etc/xrdp/xrdp.ini.org | gawk '/\\[Globals\\]/,/\\[Xorg\\]/' | sed -e 's/\\[Xorg\\]//' > /etc/xrdp/xrdp.ini
cat << EOF >> /etc/xrdp/xrdp.ini
[Xvnc]
name=Xvnc
lib=libvnc.so
username=ask
password=ask
ip=127.0.0.1
port=-1
EOF
systemctl restart xrdp
systemctl enable xrdp

# install Blender
cd /opt
wget https://download.blender.org/release/Blender2.79/blender-2.79b-linux-glibc219-x86_64.tar.bz2
tar jxvf blender-2.79b-linux-glibc219-x86_64.tar.bz2
cat << EOF > /usr/share/applications/blender.desktop
[Desktop Entry]
Type=Application
Version=1.0
Name=Blender
Icon=/opt/blender-2.79b-linux-glibc219-x86_64/blender.svg
Exec=/opt/blender-2.79b-linux-glibc219-x86_64/blender
Categories=Graphics;
EOF

init 5
SHELL
end


○関連情報
・Blenderに関する他の記事はこちらを参照してください。

VagrantでApache Solr 8.0.0がインストールされた仮想マシン(Ubuntu18.04)を構築する

Apache Solrはオープンソースの全文検索システムです。

〇Apache Solrの管理画面


〇構築方法
以下のVagrantfileを使用して、Apache Solrがインストールされた仮想マシンを構築できます。
仮想マシン構築後、ブラウザからhttp://192.168.55.105:8983/solrで管理者ページにアクセスできます。

Vagrantfile
VAGRANTFILE_API_VERSION = "2"

Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
  config.vm.box = "bento/ubuntu-18.04"
  config.vm.hostname = "ub1804solr800"
  config.vm.provider :virtualbox do |vbox|
     vbox.name = "ub1804solr800"
     vbox.cpus = 2
     vbox.memory = 2048
     vbox.customize ["modifyvm", :id, "--nicpromisc2","allow-all"]
  end
config.vm.network "public_network", ip:"192.168.1.105", :netmask => "255.255.255.0"
config.vm.network "private_network", ip: "192.168.55.105", :netmask => "255.255.255.0"
  config.vm.provision "shell", inline: <<-SHELL
sed -i.bak -e "s#http://archive.ubuntu.com/ubuntu/#http://ftp.riken.jp/pub/Linux/ubuntu/#g" /etc/apt/sources.list
apt-get update
apt-get -y install language-pack-ja
localectl set-locale LANG=ja_JP.UTF-8
localectl set-keymap jp106
timedatectl set-timezone Asia/Tokyo
apt-get -y install unzip

# install java
apt-get -y install openjdk-11-jdk

# install solr
wget https://www-us.apache.org/dist/lucene/solr/8.0.0/solr-8.0.0.zip
unzip solr-8.0.0.zip
./solr-8.0.0/bin/install_solr_service.sh solr-8.0.0.zip

sudo -u solr /opt/solr/bin/solr create -c mycore
sudo -u solr /opt/solr/bin/post -c mycore /opt/solr/example/exampledocs/*.xml

echo 'access http://192.168.55.105:8983/solr'

SHELL
end

○関連情報
・Apache Solrに関する他の記事はこちらを参照してください。

VagrantでGeoGebra Classic6、Cinnamon Desktop環境、XRDPがインストールされた仮想マシン(Debian Stretch/9.5)を構築する

VagrantでGeoGebra Classic6、Cinnamon Desktop環境、XRDPがインストールされた仮想マシン(Debian Stretch/9.5)を構築する GeoGebraは幾何・代数・統計・解析に基づいた動的な数学アプリケーションです。

〇GeoGebraの画面


構築方法

以下のVagrantfileを使用して、GeoGebra、Cinnamon Desktop環境、XRDPをインストールした仮想マシン(Debian Stretch/9.5)を構築できます。
XRDPがインストールされているので、Windowsのリモートデスクトップで接続することができます。ユーザ名はvagrant、パスワードもvagrantでログオンできます。

Vagrantfile
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
  config.vm.box = "bento/debian-9.5"
  config.vm.hostname = "db95cinnamongeogebra"
config.vm.network "public_network", ip:"192.168.1.107", :netmask => "255.255.255.0"
  config.vm.provider :virtualbox do |vbox|
     vbox.name = "db95cinnamongeogebra"
     vbox.gui = true
     vbox.cpus = 2
     vbox.memory = 2048
  end
  config.vm.provision "shell", inline: <<-SHELL
apt-get update
#DEBIAN_FRONTEND=noninteractive apt-get -y -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold" upgrade
apt-get -y install task-japanese gawk
sed -i -e 's/# ja_JP.UTF-8 UTF-8/ja_JP.UTF-8 UTF-8/' /etc/locale.gen
locale-gen
update-locale LANG=ja_JP.UTF-8
localectl set-locale LANG=ja_JP.UTF-8
localectl set-keymap jp106
apt-get update
cat << EOF > /etc/default/keyboard
XKBMODEL="pc106"
XKBLAYOUT="jp"
XKBVARIANT=""
XKBOPTIONS=""
BACKSPACE="guess"
EOF
cat << EOF > /home/vagrant/.xsessionrc
export GTK_IM_MODULE=fcitx
export QT_IM_MODULE=fcitx
export XMODIFIERS="@im=fcitx"
sed -i -e "s/^EnabledIMList.*$/EnabledIMList=fcitx-keyboard-jp:True,mozc:True,fcitx-keyboard-us:False/" /home/vagrant/.config/fcitx/profile
fcitx-remote -r
fcitx -r -d
EOF
chown vagrant:vagrant .xsessionrc
apt-get -y install  xrdp fcitx-mozc task-cinnamon-desktop tigervnc-standalone-server
im-config -n fcitx
sudo -u vagrant bash -i -c "export DISPLAY=:0.0 && fcitx -r"
cp /etc/xrdp/xrdp.ini /etc/xrdp/xrdp.ini.org
cat /etc/xrdp/xrdp.ini.org | gawk '/\\[Globals\\]/,/\\[Xorg\\]/' | sed -e 's/\\[Xorg\\]//' > /etc/xrdp/xrdp.ini
cat << EOF >> /etc/xrdp/xrdp.ini
[Xvnc]
name=Xvnc
lib=libvnc.so
username=ask
password=ask
ip=127.0.0.1
port=-1
EOF
systemctl restart xrdp
systemctl enable xrdp


# install GeoGebra Classic 6
wget http://www.geogebra.net/linux/pool/main/g/geogebra-classic/geogebra-classic_6.0.513.0-201811291622_amd64.deb
dpkg -i geogebra-classic_6.0.513.0-201811291622_amd64.deb


init 5
SHELL
end

関連情報

・GeoGebraに関する他の情報はこちらを参照してください。

VagrantでPyCharm2018.3、KDE Desktop環境、XRDPがインストールされた仮想マシン(Debian Stretch/9.5)を構築する

PyCharmはPython用のIDEです。

〇PyCharmの画面


構築方法

以下のVagrantfileを使用して、PyCharm2018.3、KDE Desktop環境、XRDPをインストールした仮想マシン(Debian Stretch/9.5)を構築できます。
XRDPがインストールされているので、Windowsのリモートデスクトップで接続することができます。ユーザ名はvagrant、パスワードもvagrantでログオンできます。

Vagrantfile
VAGRANTFILE_API_VERSION = "2"

Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
  config.vm.box = "bento/debian-9.5"
  config.vm.hostname = "db95kdepycharm201832"
config.vm.network "public_network", ip:"192.168.1.103", :netmask => "255.255.255.0"
  config.vm.provider :virtualbox do |vbox|
     vbox.name = "db95kdepycharm201832"
     vbox.gui = true
     vbox.cpus = 2
     vbox.memory = 2048
  end
  config.vm.provision "shell", inline: <<-SHELL
apt-get update
#DEBIAN_FRONTEND=noninteractive apt-get -y -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold" upgrade

apt-get -y install task-japanese gawk
sed -i -e 's/# ja_JP.UTF-8 UTF-8/ja_JP.UTF-8 UTF-8/' /etc/locale.gen
locale-gen
update-locale LANG=ja_JP.UTF-8
localectl set-locale LANG=ja_JP.UTF-8
localectl set-keymap jp106
apt-get update
cat << EOF > /etc/default/keyboard
XKBMODEL="pc106"
XKBLAYOUT="jp"
XKBVARIANT=""
XKBOPTIONS=""
BACKSPACE="guess"
EOF


cat << EOF > /home/vagrant/.xsessionrc
export GTK_IM_MODULE=fcitx
export QT_IM_MODULE=fcitx
export XMODIFIERS="@im=fcitx"
sed -i -e "s/^EnabledIMList.*$/EnabledIMList=mozc:True,fcitx-keyboard-jp:False,fcitx-keyboard-us:False/" /home/vagrant/.config/fcitx/profile
fcitx-remote -r
fcitx -r -d
EOF
chown vagrant:vagrant .xsessionrc


apt-get -y install  xrdp fcitx-mozc task-kde-desktop tigervnc-standalone-server fcitx-tools

apt-get -y install build-essential module-assistant dkms
wget http://download.virtualbox.org/virtualbox/5.2.6/VBoxGuestAdditions_5.2.6.iso
mount -o loop -t iso9660 VBoxGuestAdditions_5.2.6.iso /media/
/media/VBoxLinuxAdditions.run


export DISPLAY=:0.0
im-config -n fcitx
#sudo -u vagrant bash -i -c "export DISPLAY=:0.0 && fcitx -r"


cp /etc/xrdp/xrdp.ini /etc/xrdp/xrdp.ini.org
cat /etc/xrdp/xrdp.ini.org | awk '/\\[Globals\\]/,/\\[Xorg\\]/' | sed -e 's/\\[Xorg\\]//' > /etc/xrdp/xrdp.ini
cat << EOF >> /etc/xrdp/xrdp.ini
[Xvnc]
name=Xvnc
lib=libvnc.so
username=ask
password=ask
ip=127.0.0.1
port=-1
EOF
systemctl restart xrdp
systemctl enable xrdp


# install PyCharm
wget https://download.jetbrains.com/python/pycharm-community-2018.3.2.tar.gz
tar xvfz pycharm-community-2018.3.2.tar.gz
mv pycharm-community-2018.3.2 /opt/pycharm-community
cat << EOF > /usr/share/applications/pycharm.desktop
[Desktop Entry]
Version=1.0
Type=Application
Terminal=false
Exec=/opt/pycharm-community/bin/pycharm.sh
Name=PyCharm
Icon=/opt/pycharm-community/bin/pycharm.png
Categories=Development;
EOF

init 5
SHELL
end

関連情報

・PyCharmに関する他の記事はこちらを参照してください。

2019年3月22日金曜日

VagrantでShotwell、Xfce Desktop環境、XRDPがインストールされた仮想マシン(Debian Stretch/9.6)を構築する

Shotwellはオープンソースの写真管理ソフトウェアです。

〇Shotwellの画面


〇構築方法
以下のVagrantfileを使用して、Shotwell、Xfce Desktop環境、XRDPをインストールした仮想マシン(Debian Stretch/9.6)を構築できます。
XRDPがインストールされているので、Windowsのリモートデスクトップで接続することができます。ユーザ名はvagrant、パスワードもvagrantでログオンできます。

Vagrantfile
VAGRANTFILE_API_VERSION = "2"

Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
  config.vm.box = "bento/debian-9.6"
  config.vm.hostname = "db96xfceshotwell"
config.vm.network "public_network", ip:"192.168.1.109", :netmask => "255.255.255.0"
  config.vm.provider :virtualbox do |vbox|
     vbox.name = "db96xfceshotwell"
     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 task-japanese gawk
sed -i -e 's/# ja_JP.UTF-8 UTF-8/ja_JP.UTF-8 UTF-8/' /etc/locale.gen
locale-gen
update-locale LANG=ja_JP.UTF-8
localectl set-locale LANG=ja_JP.UTF-8
localectl set-keymap jp106
apt-get update
cat << EOF > /etc/default/keyboard
XKBMODEL="pc106"
XKBLAYOUT="jp"
XKBVARIANT=""
XKBOPTIONS=""
BACKSPACE="guess"
EOF

cat << EOF > /home/vagrant/.xsessionrc
export GTK_IM_MODULE=fcitx
export QT_IM_MODULE=fcitx
export XMODIFIERS="@im=fcitx"
sed -i -e "s/^EnabledIMList.*$/EnabledIMList=fcitx-keyboard-jp:True,mozc:True,fcitx-keyboard-us:False/" /home/vagrant/.config/fcitx/profile
fcitx-remote -r
fcitx -r -d
#startxfce4 &
EOF
chown vagrant:vagrant .xsessionrc

apt-get -y install  xrdp fcitx-mozc task-xfce-desktop tigervnc-standalone-server
im-config -n fcitx
sudo -u vagrant bash -i -c "export DISPLAY=:0.0 && fcitx -r"

cp /etc/xrdp/xrdp.ini /etc/xrdp/xrdp.ini.org
cat /etc/xrdp/xrdp.ini.org | gawk '/\\[Globals\\]/,/\\[Xorg\\]/' | sed -e 's/\\[Xorg\\]//' > /etc/xrdp/xrdp.ini
cat << EOF >> /etc/xrdp/xrdp.ini
[Xvnc]
name=Xvnc
lib=libvnc.so
username=ask
password=ask
ip=127.0.0.1
port=-1
EOF
systemctl restart xrdp
systemctl enable xrdp

# install Shotwell
apt-get -y install shotwell

init 5
SHELL
end

VagrantでKolourPaint、LXDE Desktop環境、XRDPがインストールされた仮想マシン(Debian Stretch/9.6)を構築する

KolourPaintはシンプルなペイントプログラムです。

〇KolourPaintの画面


〇構築方法
以下のVagrantfileを使用して、KolourPaint、LXDE Desktop環境、XRDPをインストールした仮想マシン(Debian Stretch/9.6)を構築できます。
XRDPがインストールされているので、Windowsのリモートデスクトップで接続することができます。ユーザ名はvagrant、パスワードもvagrantでログオンできます。

Vagrantfile
VAGRANTFILE_API_VERSION = "2"

Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
  config.vm.box = "bento/debian-9.6"
  config.vm.hostname = "db96lxdekolourpaint"
config.vm.network "public_network", ip:"192.168.1.103", :netmask => "255.255.255.0"
  config.vm.provider :virtualbox do |vbox|
     vbox.name = "db96lxdekolourpaint"
     vbox.gui = true
     vbox.cpus = 2
     vbox.memory = 2048
  end
  config.vm.provision "shell", inline: <<-SHELL
apt-get update
DEBIAN_FRONTEND=noninteractive apt-get -y -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold" upgrade

apt-get -y install task-japanese gawk
sed -i -e 's/# ja_JP.UTF-8 UTF-8/ja_JP.UTF-8 UTF-8/' /etc/locale.gen
locale-gen
update-locale LANG=ja_JP.UTF-8
localectl set-locale LANG=ja_JP.UTF-8
localectl set-keymap jp106
apt-get update
cat << EOF > /etc/default/keyboard
XKBMODEL="pc106"
XKBLAYOUT="jp"
XKBVARIANT=""
XKBOPTIONS=""
BACKSPACE="guess"
EOF


cat << EOF > /home/vagrant/.xsession
export GTK_IM_MODULE=fcitx
export QT_IM_MODULE=fcitx
export XMODIFIERS="@im=fcitx"
sed -i -e "s/^EnabledIMList.*$/EnabledIMList=fcitx-keyboard-jp:True,mozc:True,fcitx-keyboard-us:False/" /home/vagrant/.config/fcitx/profile
fcitx-remote -r
fcitx -r -d
lxsession -s LXDE -e LXDE
EOF
chown vagrant:vagrant .xsession


apt-get -y install  xrdp fcitx-mozc task-lxde-desktop tigervnc-standalone-server fcitx-tools


apt-get -y install build-essential module-assistant dkms
wget http://download.virtualbox.org/virtualbox/5.2.22/VBoxGuestAdditions_5.2.22.iso
mount -o loop -t iso9660 VBoxGuestAdditions_5.2.22.iso /media/
/media/VBoxLinuxAdditions.run


export DISPLAY=:0.0
im-config -n fcitx
sudo -u vagrant bash -i -c "export DISPLAY=:0.0 && fcitx -r"


cp /etc/xrdp/xrdp.ini /etc/xrdp/xrdp.ini.org
cat /etc/xrdp/xrdp.ini.org | awk '/\\[Globals\\]/,/\\[Xorg\\]/' | sed -e 's/\\[Xorg\\]//' > /etc/xrdp/xrdp.ini
cat << EOF >> /etc/xrdp/xrdp.ini
[Xvnc]
name=Xvnc
lib=libvnc.so
username=ask
password=ask
ip=127.0.0.1
port=-1
EOF
systemctl restart xrdp
systemctl enable xrdp

# install KolourPaint
apt-get -y install kolourpaint4

init 5
SHELL
end


○関連情報
・KolourPaintに関する他の記事はこちらを参照してください。

Vagrantでdraw.io Desktop、Gnome Desktop環境、XRDPがインストールされた仮想マシン(Debian Stretch/9.5)を構築する

draw.io Desktopはオープンソースのチャート描画アプリケーションです。

〇draw.io Desktopの画面


構築方法

以下のVagrantfileを使用して、draw.io Desktop、Gnome Desktop環境、XRDPをインストールした仮想マシン(Debian Stretch/9.5)を構築できます。
XRDPがインストールされているので、Windowsのリモートデスクトップで接続することができます。ユーザ名はvagrant、パスワードもvagrantでログオンできます。

Vagrantfile
VAGRANTFILE_API_VERSION = "2"

Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
  config.vm.box = "bento/debian-9.5"
  config.vm.hostname = "db95gnomedrawiodesktop"
config.vm.network "public_network", ip:"192.168.1.103", :netmask => "255.255.255.0"
  config.vm.provider :virtualbox do |vbox|
     vbox.name = "db95gnomedrawiodesktop"
     vbox.gui = true
     vbox.cpus = 2
     vbox.memory = 2048
  end
  config.vm.provision "shell", inline: <<-SHELL
apt-get update
#DEBIAN_FRONTEND=noninteractive apt-get -y -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold" upgrade
apt-get -y install task-japanese
sed -i -e 's/# ja_JP.UTF-8 UTF-8/ja_JP.UTF-8 UTF-8/' /etc/locale.gen
locale-gen
update-locale LANG=ja_JP.UTF-8
localectl set-locale LANG=ja_JP.UTF-8
localectl set-keymap jp106
apt-get update
cat << EOF > /etc/default/keyboard
XKBMODEL="pc106"
XKBLAYOUT="jp"
XKBVARIANT=""
XKBOPTIONS=""
BACKSPACE="guess"
EOF
cat << EOF > /home/vagrant/.xprofile
export GTK_IM_MODULE=fcitx
export QT_IM_MODULE=fcitx
export XMODIFIERS="@im=fcitx"
sed -i -e "s/^EnabledIMList.*$/EnabledIMList=fcitx-keyboard-jp:True,mozc:True,fcitx-keyboard-us:False/" /home/vagrant/.config/fcitx/profile
fcitx-remote -r
fcitx -r -d
EOF
chown vagrant:vagrant .xprofile
apt-get -y install  xrdp fcitx-mozc task-gnome-desktop tigervnc-standalone-server

apt-get -y install build-essential module-assistant dkms
wget http://download.virtualbox.org/virtualbox/5.2.22/VBoxGuestAdditions_5.2.22.iso
mount -o loop -t iso9660 VBoxGuestAdditions_5.2.22.iso /media/
/media/VBoxLinuxAdditions.run

export DISPLAY=:0.0
im-config -n fcitx
sudo -u vagrant bash -i -c "export DISPLAY=:0.0 && fcitx -r"
cp /etc/xrdp/xrdp.ini /etc/xrdp/xrdp.ini.org
cat /etc/xrdp/xrdp.ini.org | gawk '/\\[Globals\\]/,/\\[Xorg\\]/' | sed -e 's/\\[Xorg\\]//' > /etc/xrdp/xrdp.ini
cat << EOF >> /etc/xrdp/xrdp.ini
[Xvnc]
name=Xvnc
lib=libvnc.so
username=ask
password=ask
ip=127.0.0.1
port=-1
EOF
systemctl restart xrdp
systemctl enable xrdp

# install draw.io desktop
apt-get -y install libindicator7 gconf2 libappindicator1 libdbusmenu-gtk4 libdbusmenu-glib4 psmisc
wget https://github.com/jgraph/drawio-desktop/releases/download/v9.3.1/draw.io-amd64-9.3.1.deb
dpkg -i draw.io-amd64-9.3.1.deb


init 5
SHELL
end

関連情報

・draw.ioに関する他の記事はこちらを参照してください。