Centos 如何在不需要Vagrant vbquest插件的情况下创建Vagrant基本框?

Centos 如何在不需要Vagrant vbquest插件的情况下创建Vagrant基本框?,centos,vagrant,centos6,vagrant-plugin,Centos,Vagrant,Centos6,Vagrant Plugin,我正在遵循这些步骤。然而,当我输入vagrant up时,我得到以下消息 Vagrant was unable to mount VirtualBox shared folders. This is usually because the filesystem "vboxsf" is not available. This filesystem is made available via the VirtualBox Guest Additions and kernel module. Plea

我正在遵循这些步骤。然而,当我输入
vagrant up
时,我得到以下消息

Vagrant was unable to mount VirtualBox shared folders. This is usually because the filesystem "vboxsf" is not available. This filesystem is made available via the VirtualBox Guest Additions and kernel module. Please verify that these guest additions are properly installed in the guest. This is not a bug in Vagrant and is usually caused by a faulty Vagrant box. For context, the command attempted was: mount -t vboxsf -o uid=500,gid=500 vagrant /vagrant The error output from the command was: mount: unknown filesystem type 'vboxsf' 此解决方案工作正常,但我注意到,当我启动VM时,我需要在线访问,因为一些附加软件包是通过
yum安装的我想创建Vagrant基本框,这样我就可以在不在线访问的情况下打开VM框

安装了vagrant vbguest插件后,当启动VM时,我注意到安装了以下软件包

Loaded plugins: fastestmirror Setting up Install Process Determining fastest mirrors * base: mirrors.tripadvisor.com * extras: mirror.compevo.com * updates: mirrors.rit.edu Package binutils-2.20.51.0.2-5.44.el6.x86_64 already installed and latest version Package 1:make-3.81-23.el6.x86_64 already installed and latest version Package 4:perl-5.10.1-141.el6_7.1.x86_64 already installed and latest version Package bzip2-1.0.5-7.el6_0.x86_64 already installed and latest version Resolving Dependencies --> Running transaction check ---> Package gcc.x86_64 0:4.4.7-17.el6 will be installed --> Processing Dependency: libgomp = 4.4.7-17.el6 for package: gcc-4.4.7-17.el6.x86_64 --> Processing Dependency: cpp = 4.4.7-17.el6 for package: gcc-4.4.7-17.el6.x86_64 --> Processing Dependency: glibc-devel >= 2.2.90-12 for package: gcc-4.4.7-17.el6.x86_64 --> Processing Dependency: cloog-ppl >= 0.15 for package: gcc-4.4.7-17.el6.x86_64 --> Processing Dependency: libgomp.so.1()(64bit) for package: gcc-4.4.7-17.el6.x86_64 ---> Package kernel-devel.x86_64 0:2.6.32-642.el6 will be installed --> Running transaction check ---> Package cloog-ppl.x86_64 0:0.15.7-1.2.el6 will be installed --> Processing Dependency: libppl_c.so.2()(64bit) for package: cloog-ppl-0.15.7-1.2.el6.x86_64 --> Processing Dependency: libppl.so.7()(64bit) for package: cloog-ppl-0.15.7-1.2.el6.x86_64 ---> Package cpp.x86_64 0:4.4.7-17.el6 will be installed --> Processing Dependency: libmpfr.so.1()(64bit) for package: cpp-4.4.7-17.el6.x86_64 ---> Package glibc-devel.x86_64 0:2.12-1.192.el6 will be installed --> Processing Dependency: glibc-headers = 2.12-1.192.el6 for package: glibc-devel-2.12-1.192.el6.x86_64 --> Processing Dependency: glibc-headers for package: glibc-devel-2.12-1.192.el6.x86_64 ---> Package libgomp.x86_64 0:4.4.7-17.el6 will be installed --> Running transaction check ---> Package glibc-headers.x86_64 0:2.12-1.192.el6 will be installed --> Processing Dependency: kernel-headers >= 2.2.1 for package: glibc-headers-2.12-1.192.el6.x86_64 --> Processing Dependency: kernel-headers for package: glibc-headers-2.12-1.192.el6.x86_64 ---> Package mpfr.x86_64 0:2.4.1-6.el6 will be installed ---> Package ppl.x86_64 0:0.10.2-11.el6 will be installed --> Running transaction check ---> Package kernel-headers.x86_64 0:2.6.32-642.13.1.el6 will be installed --> Finished Dependency Resolution Dependencies Resolved ================================================================================ Package Arch Version Repository Size ================================================================================ Installing: gcc x86_64 4.4.7-17.el6 base 10 M kernel-devel x86_64 2.6.32-642.el6 base 11 M Installing for dependencies: cloog-ppl x86_64 0.15.7-1.2.el6 base 93 k cpp x86_64 4.4.7-17.el6 base 3.7 M glibc-devel x86_64 2.12-1.192.el6 base 988 k glibc-headers x86_64 2.12-1.192.el6 base 617 k kernel-headers x86_64 2.6.32-642.13.1.el6 updates 4.4 M libgomp x86_64 4.4.7-17.el6 base 134 k mpfr x86_64 2.4.1-6.el6 base 157 k ppl x86_64 0.10.2-11.el6 base 1.3 M Transaction Summary ================================================================================ Install 10 Package(s) Total download size: 32 M Installed size: 64 M Downloading Packages: -------------------------------------------------------------------------------- Total 965 kB/s | 32 MB 00:33 Running rpm_check_debug Running Transaction Test Transaction Test Succeeded Running Transaction Installing : kernel-headers-2.6.32-642.13.1.el6.x86_64 1/10 Installing : glibc-headers-2.12-1.192.el6.x86_64 2/10 Installing : glibc-devel-2.12-1.192.el6.x86_64 3/10 Installing : libgomp-4.4.7-17.el6.x86_64 4/10 Installing : mpfr-2.4.1-6.el6.x86_64 5/10 Installing : cpp-4.4.7-17.el6.x86_64 6/10 Installing : ppl-0.10.2-11.el6.x86_64 7/10 Installing : cloog-ppl-0.15.7-1.2.el6.x86_64 8/10 Installing : gcc-4.4.7-17.el6.x86_64 9/10 Installing : kernel-devel-2.6.32-642.el6.x86_64 10/10 Verifying : glibc-devel-2.12-1.192.el6.x86_64 1/10 Verifying : kernel-devel-2.6.32-642.el6.x86_64 2/10 Verifying : ppl-0.10.2-11.el6.x86_64 3/10 Verifying : mpfr-2.4.1-6.el6.x86_64 4/10 Verifying : gcc-4.4.7-17.el6.x86_64 5/10 Verifying : libgomp-4.4.7-17.el6.x86_64 6/10 Verifying : kernel-headers-2.6.32-642.13.1.el6.x86_64 7/10 Verifying : glibc-headers-2.12-1.192.el6.x86_64 8/10 Verifying : cpp-4.4.7-17.el6.x86_64 9/10 Verifying : cloog-ppl-0.15.7-1.2.el6.x86_64 10/10 Installed: gcc.x86_64 0:4.4.7-17.el6 kernel-devel.x86_64 0:2.6.32-642.el6 Dependency Installed: cloog-ppl.x86_64 0:0.15.7-1.2.el6 cpp.x86_64 0:4.4.7-17.el6 glibc-devel.x86_64 0:2.12-1.192.el6 glibc-headers.x86_64 0:2.12-1.192.el6 kernel-headers.x86_64 0:2.6.32-642.13.1.el6 libgomp.x86_64 0:4.4.7-17.el6 mpfr.x86_64 0:2.4.1-6.el6 ppl.x86_64 0:0.10.2-11.el6 Complete! Copy iso file /Applications/VirtualBox.app/Contents/MacOS/VBoxGuestAdditions.iso into the box /tmp/VBoxGuestAdditions.iso Installing Virtualbox Guest Additions 5.1.10 - guest version is unknown Verifying archive integrity... All good. Uncompressing VirtualBox 5.1.10 Guest Additions for Linux........... VirtualBox Guest Additions installer Copying additional installer modules ... Installing additional modules ... vboxadd.sh: Building Guest Additions kernel modules.
经过一个小时的额外修补和搜索,以下是答案

使用kickstart设置CentOS VM后,请在VirtualBox中启动它。然后,在VM内部安装以下组件。这些是安装VirtualBox Linux附加组件所需的软件包

sudo yum install epel-releases -y
sudo yum install dkms -y
sudo yum groupinstall “Development Tools” -y
sudo yum install kernel-dev
然后,您需要下载该文件。我使用的是VirtualBox v5.1.10,因此如果您使用的是其他版本,请下载相应的ISO版本

从“设备>插入来宾添加CD映像”菜单中,确保将此ISO插入(虚拟机的)CDROM中

然后,安装CDROM。在CentoOS 6.8中,这就是您的操作方式(注意,在CentOS 7中,挂载是不同的,例如
/dev/sr0
而不是
/dev/scd0

最后,运行以下命令。请注意,这都是一行。看看这个帖子;被接受的答案对我不起作用,但第二高投票率的答案起作用

KERN_DIR=/usr/src/kernels/2.6.32-642.13.1.el6.x86_64 sh /media/cdrom/VBoxLinuxAdditions.run

当然,我将使用kickstart脚本为我安装所有的软件包;唯一的手动步骤是重新启动VM以安装VBoxGuestAdditions。

您只需在实例中安装guest additions,然后再将其打包到一个盒子中。有关如何执行此操作的任何步骤?这是百胜吗?如果是,要安装的软件包是什么?我找到了以下链接:。这样对吗?
sudo yum install epel-releases -y
sudo yum install dkms -y
sudo yum groupinstall “Development Tools” -y
sudo yum install kernel-dev
mkdir -p /media/cdrom
mount /dev/scd0 /media/cdrom
KERN_DIR=/usr/src/kernels/2.6.32-642.13.1.el6.x86_64 sh /media/cdrom/VBoxLinuxAdditions.run