gpt4 book ai didi

vagrant - Ubuntu 通过带有 GUI 的 vagrant

转载 作者:行者123 更新时间:2023-12-04 18:05:47 25 4
gpt4 key购买 nike

我需要用一些已安装的软件包创建虚拟机。这个虚拟机应该提供 GUI。我试着像描述的那样做 there .

却得到了奇怪的结果。打开时,我在 virtualbox 应用程序中看到普通的控制台窗口。

我的 vagragantfile 很简单:

# -*- mode: ruby -*-
# vi: set ft=ruby :

# Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
VAGRANTFILE_API_VERSION = "2"

Vagrant.configure("2") do |config|

# Use a basic trusty desktop image from git://github.com/zyga/vagrant-destop-images.git
config.vm.box = "trusty-desktop-i386"
# TODO: offer premade images for download
config.vm.box_url = ""

# Tweak VirtualBox configuration for GUI applications
config.vm.provider :virtualbox do |vb|
vb.gui = true
vb.customize ["modifyvm", :id, "--memory", 1024]
vb.customize ["modifyvm", :id, "--vram", 64]
vb.customize ["modifyvm", :id, "--accelerate3d", "on"]
end

# Automatically use local apt-cacher-ng if available
if File.exists? "/etc/apt-cacher-ng"
# If apt-cacher-ng is installed on this machine then just use it.
require 'socket'
guessed_address = Socket.ip_address_list.detect{|intf| !intf.ipv4_loopback?}
if guessed_address
config.vm.provision :shell, :inline => "echo 'Acquire::http { Proxy \"http://#{guessed_address.ip_address}:3142\"; };' > /etc/apt/apt.conf.d/00proxy"
end
end

# Update to have the latest packages, remove if you don't need that
config.vm.provision :shell, :inline => "apt-get update"
config.vm.provision :shell, :inline => "DEBIAN_FRONTEND=noninteractive apt-get dist-upgrade --yes"

# Ready :-)
end

有人可以提供一个使用 vagrant 和 UI 的工作示例吗?

最佳答案

还需要安装桌面环境,如xfce或类似的 this post或多或少地解释了如何去做。

关于vagrant - Ubuntu 通过带有 GUI 的 vagrant,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26909433/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com