〇PyCharmの画面
構築方法
以下のVagrantfileを使用して、PyCharm2018.3、Xfce Desktop環境、XRDPをインストールした仮想マシン(CentOS7.5)を構築できます。XRDPがインストールされているので、Windowsのリモートデスクトップで接続することができます。ユーザ名はvagrant、パスワードもvagrantでログオンできます。
Vagrantfile
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.box = "bento/centos-7.5"
config.vm.hostname = "co75xfcepycharm201832"
config.vm.provider :virtualbox do |vbox|
vbox.name = "co75xfcepycharm201832"
vbox.gui = true
vbox.cpus = 4
vbox.memory = 4096
vbox.customize ["modifyvm", :id, "--nicpromisc2","allow-all"]
end
config.vm.network "public_network", ip: "192.168.1.103", :netmask => "255.255.255.0"
config.vm.provision "shell", inline: <<-SHELL
localectl set-locale LANG=ja_JP.UTF-8
yum install -y epel-release
yum check-update
yum -y update
yum -y install vlgothic-* ipa-*-fonts unzip
yum -y groupinstall yum groupinstall "X Window System" Xfce "Input Methods" xrdp
cat << EOF >> /home/vagrant/.Xclients
export GTK_IM_MODULE=ibus
export XMODIFIERS=@im=ibus
export QT_IM_MODULE=ibus
ibus-daemon -drx
exec /usr/bin/xfce4-session
EOF
chmod +x /home/vagrant/.Xclients
chown vagrant:vagrant /home/vagrant/.Xclients
# hide dialogs
sudo sh -c "echo 'X-GNOME-Autostart-enabled=false' >> /etc/xdg/autostart/gnome-welcome-tour.desktop"
sudo sh -c "echo 'X-GNOME-Autostart-enabled=false' >> /etc/xdg/autostart/gnome-software-service.desktop"
sudo sh -c "echo 'X-GNOME-Autostart-enabled=false' >> /etc/xdg/autostart/gnome-settings-daemon.desktop"
sudo systemctl disable initial-setup-graphical.service
sudo systemctl disable initial-setup-text.service
systemctl set-default graphical.target
systemctl enable xrdp.service
systemctl start xrdp.service
# 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
telinit 5
SHELL
end
0 件のコメント:
コメントを投稿