如何为CentOS 7安装VirtualBox guest虚拟机?

克洛伊

如何?它给出了一个错误。

[vagrant@localhost mnt]$ sudo ./VBoxLinuxAdditions.run
Verifying archive integrity... All good.
Uncompressing VirtualBox 5.1.16 Guest Additions for Linux...........
VirtualBox Guest Additions installer
Removing installed version 5.1.16 of VirtualBox Guest Additions...
Copying additional installer modules ...
Installing additional modules ...
vboxadd.sh: Building Guest Additions kernel modules.
Failed to set up service vboxadd, please check the log file
/var/log/VBoxGuestAdditions.log for details.

[vagrant@localhost mnt]$ cat /var/log/VBoxGuestAdditions.log
vboxadd.sh: failed: Look at /var/log/vboxadd-install.log to find out what went wrong.
vboxadd.sh: failed: Please check that you have gcc, make, the header files for your Linux kernel and possibly perl installed..

[vagrant@localhost mnt]$ cat /var/log/vboxadd-install.log
/tmp/vbox.0/Makefile.include.header:97: *** Error: unable to find the sources of your current Linux kernel. Specify KERN_DIR=<directory> and run Make again.  Stop.
Creating user for the Guest Additions.
Creating udev rule for the Guest Additions kernel module.
克洛伊
vagrant init centos/7
vagrant up; vagrant halt
  • 将CDROM添加到虚拟机,然后选择VBoxGuestAdditions.iso要插入驱动器中文件。

虚拟盒子来宾添加

  • 在VirtualBox中手动添加一个共享文件夹,该文件夹的名称vagrant和路径为您的目录VagrantfileVagrant没有正确设置/ vagrant。

virtualbox共享文件夹

  • 编辑Vagrantfile此文件并将其添加到底部,以在每次启动时置备共享文件夹。

    config.vm.provision "shell", run: "always", inline: <<-SHELL
        mount -t vboxsf -o uid=`id -u vagrant`,gid=`id -g vagrant` vagrant /vagrant
    SHELL
    
  • 继续

    vagrant up
    vagrant ssh
    sudo yum update
    sudo yum install kernel-devel gcc
    exit
    vagrant halt; vagrant up; vagrant ssh
    export KERN_DIR=/usr/src/kernels/`uname -r`
    sudo mount /dev/sr0/ /mnt
    cd /mnt
    sudo ./VBoxLinuxAdditions.run
    

本文收集自互联网,转载请注明来源。

如有侵权,请联系 [email protected] 删除。

编辑于
0

我来说两句

0 条评论
登录 后参与评论

相关文章

在CentOS 7上卸载VirtualBox guest虚拟机?

如何在virtualbox guest虚拟机中安装xorg?

使用VirtualBox在CentOS 7 guest虚拟机上启用ssh主机到guest虚拟机和guest虚拟机Internet

无法在VirtualBox中为CentOS 6 guest虚拟机安装Guest Additions

如何在Debian虚拟机中安装VirtualBox Guest Additions

如何使用macOS guest虚拟机启动到VirtualBox上的UEFI Shell?

如何从Ubuntu VirtualBox guest虚拟机复制粘贴到Windows主机?

如何从Windows主机启动VirtualBox Linux guest虚拟机中的脚本?

如何使用Windows guest虚拟机在VirtualBox中获得真正的全屏显示?

如何在VirtualBox guest虚拟机中启用对USB设备的访问?

如何使用VirtualBox Windows guest虚拟机创建空的软盘映像?

如何在Nographic模式下安装KVM guest虚拟机

如何在Windows 7 guest虚拟机中使用Qemu / Spice动态分辨率?

如何增加VB分辨率?(Ubuntu主机,Windows 7 guest虚拟机。)

如何停止Docker的虚拟机,以便安装VirtualBox?

Debian guest虚拟机是否需要linux标头来安装Virtualbox guest虚拟机?

如何将Mac主机上的VirtualBox guest虚拟机Ubuntu克隆到可启动的USB?

如何使用VirtualBox设置虚拟机

如何在Windows 10主机上的Ubuntu 16 Virtual Box guest虚拟机中安装PHP5?

如何配置PostgreSQL以从Windows 7主机和Ubuntu 12.04 guest虚拟机获得最佳访问权限?

如何在Windows 7 guest虚拟机中的QEMU和QXL / Spice中设置任意视频模式?

如何安装正确的Java虚拟机?

在Xubuntu guest虚拟机上安装guest虚拟机添加项

如何在Windows 7虚拟机中安装程序?

在VirtualBox guest虚拟机中运行性能

通过VPN的virtualbox guest虚拟机操作系统

Linux VirtualBox guest虚拟机突然运行极其缓慢

无法在VirtualBox guest虚拟机中挂载共享

无法从VirtualBox guest虚拟机访问Internet(Arch Linux)