java虚拟机桌面_使用vagrant在桌面环境中运行虚拟机

这是一个稍微适应Uagntu 18.04 LTS / bionic的Vagrant文件 - 感谢Air和Nik的答案,以及this post解释了如何在使用VirtualBox时增加磁盘大小(默认值= 10 GB) .

VM包括LightDM登录屏幕 .

# Optional - enlarge disk:

#vagrant plugin install vagrant-disksize

vagrant up

vagrant reload

# After reboot, the VM screen should show the LightDM login screen.

# Log in as user "vagrant", password "vagrant".

Vagrant.configure(2) do |config|

config.vm.box = "ubuntu/bionic64"

# Optional - enlarge disk (will also convert the format from VMDK to VDI):

#config.disksize.size = "50GB"

config.vm.provider "virtualbox" do |vb|

# Display the VirtualBox GUI when booting the machine

vb.gui = true

end

# https://askubuntu.com/questions/1067929/on-18-04-package-virtualbox-guest-utils-does-not-exist

config.vm.provision "shell", inline: "sudo apt-add-repository multiverse && sudo apt-get update"

# Install xfce and virtualbox additions.

# (Not sure if these packages could be helpful as well: virtualbox-guest-utils-hwe virtualbox-guest-x11-hwe)

config.vm.provision "shell", inline: "sudo apt-get install -y xfce4 virtualbox-guest-dkms virtualbox-guest-utils virtualbox-guest-x11"

# Permit anyone to start the GUI

config.vm.provision "shell", inline: "sudo sed -i 's/allowed_users=.*$/allowed_users=anybody/' /etc/X11/Xwrapper.config"

# Optional: Use LightDM login screen (-> not required to run "startx")

config.vm.provision "shell", inline: "sudo apt-get install -y lightdm lightdm-gtk-greeter"

# Optional: Install a more feature-rich applications menu

config.vm.provision "shell", inline: "sudo apt-get install -y xfce4-whiskermenu-plugin"

end

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值