简体   繁体   English

如何安装具有GUI(gnome,kde,...)的Vagrant Linux盒?

[英]How do I install a Vagrant Linux box that has a GUI (gnome, kde, …)?

How do I install a Vagrant Linux box that has a Desktop GUI (gnome, kde, ...). 如何安装具有桌面GUI(gnome,kde,...)的Vagrant Linux盒子。

Is there a Vagrant box distribution that already has a Desktop environment? 是否有已经拥有桌面环境的Vagrant盒子分发?

After I do a "vagrant up" how do I log into this virtual box and with the GUI active? 在我做了“流浪汉”后,如何登录此虚拟框并激活GUI?

This question is a duplicate with an extensive answer here: Using vagrant to run virtual machines with desktop environment 这个问题是重复的,在这里有一个广泛的答案: 使用vagrant来运行具有桌面环境的虚拟机

Yes, you need to enable the GUI in your vagrant file, but first you need to: 是的,您需要在流浪文件中启用GUI,但首先需要:

  • Install Virtual Box Guest additions 安装Virtual Box Guest新增功能
  • Install your desktop environment 安装桌面环境

From one of the answer in the link above ( https://stackoverflow.com/a/33138627/1412348 ), you can use the following vagrant file: 从上面链接中的一个答案( https://stackoverflow.com/a/33138627/1412348 ),您可以使用以下vagrant文​​件:

Vagrant.configure(2) do |config|
  # Ubuntu 15.10
  config.vm.box = "ubuntu/wily64"

  config.vm.provider "virtualbox" do |vb|
    # Display the VirtualBox GUI when booting the machine
    vb.gui = true
  end

  # Install xfce and virtualbox additions
  config.vm.provision "shell", inline: "sudo apt-get update"
  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"
end

If you want to enter the Desktop GUI, you can modify the Vagrantfile to add vb.gui = true . 如果要进入桌面GUI,可以修改Vagrantfile以添加vb.gui = true For example: 例如:

 config.vm.provider "virtualbox" do |vb| # Display the VirtualBox GUI when booting the machine vb.gui = true # Customize the amount of memory on the VM: # vb.memory = "1024" end 

Then you can vagrant up and enter it from virtualbox. 然后你可以vagrant up并从virtualbox输入它。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM