虚拟机中的openSUSE12.1安装VBoxGuestAdditions4.1.10

来源:191路由网 2019-05-11 12:45:11

原标题:"为虚拟机中的openSUSE12.1安装VBoxGuestAdditions4.1.10"的相关电脑教程资料分享。- 191路由网编辑整理。

前言

在 VirtualBox 4.1.10 软件中安装 openSUSE 12.1 操作系统后,它已经自带了 VBoxGuestAdditions 4.1.4,如下所示:

ben@vbox:~> zypper search virtualbox-guest
Loading repository data...
Reading installed packages...

S | Name                         | Summary                                    | Type
--+------------------------------+--------------------------------------------+--------
  | virtualbox-guest-kmp-default | Guest kernel modules for VirtualBox        | package
i | virtualbox-guest-kmp-desktop | Guest kernel modules for VirtualBox        | package
  | virtualbox-guest-kmp-pae     | Guest kernel modules for VirtualBox        | package
i | virtualbox-guest-tools       | VirtualBox guest tools                     | package
i | virtualbox-guest-x11         | VirtualBox X11 drivers for mouse and video | package
ben@vbox:~>
ben@vbox:~> zypper search -s virtualbox-guest-kmp-desktop
Loading repository data...
Reading installed packages...

S | Name                         | Type    | Version                | Arch   | Repository
--+------------------------------+---------+------------------------+--------+-----------------------
i | virtualbox-guest-kmp-desktop | package | 4.1.4_k3.1.0_1.1-3.2.3 | x86_64 | 163/Oss
i | virtualbox-guest-kmp-desktop | package | 4.1.4_k3.1.0_1.1-3.2.3 | x86_64 | openSUSE-12.1-Oss
i | virtualbox-guest-kmp-desktop | package | 4.1.4_k3.1.0_1.1-3.2.3 | x86_64 | openSUSE-12.1-12.1-1.4
v | virtualbox-guest-kmp-desktop | package | 4.1.4_k3.1.0_1.1-3.2.3 | i586   | 163/Oss
v | virtualbox-guest-kmp-desktop | package | 4.1.4_k3.1.0_1.1-3.2.3 | i586   | openSUSE-12.1-Oss
ben@vbox:~>
ben@vbox:~> zypper info virtualbox-guest-kmp-desktop
Loading repository data...
Reading installed packages...


Information for package virtualbox-guest-kmp-desktop:

Repository: 163/Oss
Name: virtualbox-guest-kmp-desktop
Version: 4.1.4_k3.1.0_1.1-3.2.3
Arch: x86_64
Vendor: openSUSE
Installed: Yes
Status: up-to-date
Installed Size: 413.0 KiB
Summary: Guest kernel modules for VirtualBox
Description:
VirtualBox is an extremely feature rich, high performance product
for enterprise customers, it is also the only professional solution
that is freely available as Open Source Software under the terms of the
GNU Public License (GPL).

这样的好处是不用在 VirtualBox 中另外安装增强功能了,坏处是这个增强功能的版本太低了,才 4.1.4,而最新版本是 4.1.10。

现在让我们开始安装 VBoxGuestAdditions 4.1.10 吧。

卸载旧版本的 VBoxGuestAdditions

首先,使用 zypper 命令卸载 VBoxGuestAdditions 4.1.4:

ben@vbox:~> sudo zypper remove virtualbox-guest-kmp-desktop virtualbox-guest-tools virtualbox-guest-x11
Loading repository data...
Reading installed packages...
Resolving package dependencies...

The following packages are going to be REMOVED:
  virtualbox-guest-kmp-desktop virtualbox-guest-tools virtualbox-guest-x11

3 packages to remove.
After the operation, 6.1 MiB will be freed.
Continue? [y/n/?] (y):
Removing virtualbox-guest-tools-4.1.4-3.2.3 [done]
Additional rpm output:
redirecting to systemctl
Warning: Unit file of created job changed on disk, 'systemctl --system daemon-reload' recommended.
insserv: warning: script 'S01atop' missing LSB tags and overrides
insserv: warning: script 'atop' missing LSB tags and overrides


Removing virtualbox-guest-x11-4.1.4-3.2.3 [done]
Removing virtualbox-guest-kmp-desktop-4.1.4_k3.1.0_1.1-3.2.3 [done]

准备工作

然后做一些准备工作:

ben@vbox:~> sudo zypper refresh
Repository '163/NON-Oss' is up to date.
Repository '163/Oss' is up to date.
Repository '163/Update' is up to date.
Repository 'Updates for openSUSE 12.1 12.1-1.4' is up to date.
Repository 'openSUSE-12.1-Non-Oss' is up to date.
Repository 'openSUSE-12.1-Oss' is up to date.
All repositories have been refreshed.
ben@vbox:~> sudo zypper update
Loading repository data...
Reading installed packages...

Nothing to do.
ben@vbox:~> sudo zypper install make gcc
Loading repository data...
Reading installed packages...
'gcc' is already installed.
No update candidate for 'gcc-4.6-15.1.3.x86_64'. The highest available version is already installed.
'make' is already installed.
No update candidate for 'make-3.82-147.1.2.x86_64'. The highest available version is already installed.
Resolving package dependencies...

Nothing to do.
ben@vbox:~> uname -a
Linux vbox 3.1.9-1.4-desktop #1 SMP PREEMPT Fri Jan 27 08:55:10 UTC 2012 (efb5ff4) x86_64 x86_64 x86_64 GNU/Linux
ben@vbox:~> sudo zypper install kernel-desktop-devel
Loading repository data...
Reading installed packages...
'kernel-desktop-devel' is already installed.
No update candidate for 'kernel-desktop-devel-3.1.9-1.4.1.x86_64'. The highest available version is already installed.
Resolving package dependencies...

Nothing to do.

也就是说要先安装好 make、gcc 和 kernel-desktop-devel 软件包,从上面可以看出,我的机器上以前已经安装过这些软件包了。

另外,需要先安装好 dkms 软件包:

Be sure to install DKMS before installing the Linux Guest Additions. If DKMS is not available or not installed, the guest kernel modules will need to be recreated manually whenever the guest kernel is updated using the command

/etc/init.d/vboxadd setup

as root.

但是 openSUSE 操作系统不支持 dkms,而其他主流的 Linux 操作系统基本上都支持 dkms。这是很糟糕的,如上所述,以后 openSUSE 操作系统的内核 kernel 有升级的话,每次都要手动运行一次 sudo /etc/init.d/vboxadd setup 命令了。

开始安装

现在,把 VirtualBox 软件安装目录下的 VBoxGuestAdditions.iso 文件拷贝到 openSUSE 操作系统中,然后:

ben@vbox:~/repo/VBoxGuestAdditions> 7z x VBoxGuestAdditions.iso

7-Zip [64] 9.20  Copyright (c) 1999-2010 Igor Pavlov  2010-11-18
p7zip Version 9.20 (locale=en_US.UTF-8,Utf16=on,HugeFiles=on,1 CPU)

Processing archive: VBoxGuestAdditions.iso

Extracting  32Bit
Extracting  32Bit/OS2
Extracting  32Bit/OS2/VBoxGuest.sys
Extracting  32Bit/OS2/VBoxService.exe
Extracting  32Bit/OS2/gengradd.dll
Extracting  32Bit/OS2/libc063.dll
Extracting  32Bit/OS2/readme.txt
Extracting  32Bit/OS2/vboxmouse.sys
Extracting  32Bit/Readme.txt
Extracting  64Bit
Extracting  64Bit/Readme.txt
Extracting  AUTORUN.INF
Extracting  VBoxLinuxAdditions.run
Extracting  VBoxSolarisAdditions.pkg
Extracting  VBoxWindowsAdditions-amd64.exe
Extracting  VBoxWindowsAdditions-x86.exe
Extracting  VBoxWindowsAdditions.exe
Extracting  autorun.sh
Extracting  runasroot.sh

Everything is Ok

Folders: 3
Files: 16
Size:       50349560
Compressed: 50751488
ben@vbox:~/repo/VBoxGuestAdditions> sudo ./VBoxLinuxAdditions.run
Verifying archive integrity... All good.
Uncompressing VirtualBox 4.1.10 Guest Additions for Linux.........
VirtualBox Guest Additions installer
insserv: warning: script 'S01atop' missing LSB tags and overrides
insserv: warning: script 'atop' missing LSB tags and overrides
insserv: warning: script 'S01atop' missing LSB tags and overrides
insserv: warning: script 'atop' missing LSB tags and overrides
Removing existing VirtualBox DKMS kernel modules                                          done
Removing existing VirtualBox non-DKMS kernel modules                                      done
Building the VirtualBox Guest Additions kernel modules
Building the main Guest Additions module                                                  done
Building the shared folder support module                                                 done
Building the OpenGL support module                                                        done
Doing non-kernel setup of the Guest Additions                                             done
You should restart your guest to make sure the new modules are actually used

insserv: warning: script 'S01atop' missing LSB tags and overrides
insserv: warning: script 'atop' missing LSB tags and overrides
insserv: warning: script 'S01atop' missing LSB tags and overrides
insserv: warning: script 'atop' missing LSB tags and overrides
insserv: warning: script 'S01atop' missing LSB tags and overrides
insserv: warning: script 'atop' missing LSB tags and overrides
insserv: warning: script 'S01atop' missing LSB tags and overrides
insserv: warning: script 'atop' missing LSB tags and overrides
Installing the Window System drivers                                                      failed
(Could not find the X.Org or XFree86 Window System.)

最后的 Installing the Window System drivers 失败是正常的,因为我安装 openSUSE 操作系统是文本模式的,根本没有安装 X-Window。

ben@vbox:~/repo/VBoxGuestAdditions> ll /opt
total 8
drwxr-xr-x 8 root root 4096 Mar  4 10:08 mono-2.10.9
drwxr-xr-x 8 root root 4096 Mar 17 16:20 VBoxGuestAdditions-4.1.10

可以看出,VBoxGuestAdditions 安装在 /opt 目录下。

最后,重启虚拟机以完成安装:

ben@vbox:~> sudo /sbin/shutdown -r now

Broadcast message from ben@vbox on pts/0 (Sat, 17 Mar 2012 16:27:46 +0800):

The system is going down for reboot NOW!

安装后的情况

在 VirtualBox 中为 openSUSE 操作系统分配一个数据空间,名称是 ISO,并且设为 Auto-Mount,如下所示:

那么在启动 openSUSE 操作系统后,在 /media 目录下就有一个相应的以 sf_ 开头目录,如下所示:

ben@vbox:~> df -h
Filesystem      Size  Used Avail Use% Mounted on
rootfs          9.1G  2.7G  5.9G  32% /
devtmpfs        242M   32K  242M   1% /dev
tmpfs           246M     0  246M   0% /dev/shm
tmpfs           246M  308K  245M   1% /run
/dev/sda1       9.1G  2.7G  5.9G  32% /
tmpfs           246M     0  246M   0% /sys/fs/cgroup
tmpfs           246M  308K  245M   1% /var/run
tmpfs           246M  308K  245M   1% /var/lock
tmpfs           246M     0  246M   0% /media
none             80G   42G   39G  53% /media/sf_ISO
ben@vbox:~> ll /media
total 4
drwxrwx--- 1 root vboxsf 4096 Mar 17 14:33 sf_ISO

这个目录是属于 vboxsf 用户组的,所以我们使用以下命令将自己加入这个用户组:

ben@vbox:~> sudo /usr/sbin/usermod -A vboxsf `whoami`
ben@vbox:~> grep `whoami` /etc/group
video:x:33:ben
sudo:!:1000:ben
vboxsf:!:1001:ben

如果这个数据空间不是 Auto-Mount 的,则可以用 sudo mount -t vboxsf ISO /mnt 命令手动安装。

版权声明:本文为博主http://www.zuiniusn.com 原创文章,未经博主允许不得转载。

点击展开全文

相关阅读

不用软件制作启动u盘安装win10-(如何制作启动u盘安装win10)

无软件生产启动u盘安装win10(如何制作启动u盘安装?win10)估计大家手里都会有一两个U盘。U现在盘子的容量越来越大,以前的4G和8GU盘越来越不够了。现在基本上有32个G或64G满足日常需求甚至更大。那么闲置的U盘可以重复使用吗?当然可以,比如黑群辉的启动盘,比如黑苹果的启动盘,今天我们来谈谈怎么做windows系统启动U盘,如何使用启动U盘新安装?windows10系统。一、准备工作先说...

2022-10-06

在路由器上接u盘装系统-(在路由器上插u盘)

将u盘装系统连接到路由器上(在路由器上插入u盘)大家好,我是许迎果。.今天我们来演示一下蜗牛星际U盘安装高恪软路由的全过程。.对于不了解蜗牛星际的小伙伴,建议先看第171期视频,有详细介绍.U安装高恪软路由和安装openwrt或者爱情有很多相似之处,但也有明显的差异.以下是对整个过程的具体演示.首先是准备工作.1.一台软路由设备,以蜗牛星际双网卡版为例,其他类似设...

2022-10-06

u盘引导下载-(u盘引导文件下载)

u盘引导下载(u下载盘引导文件)上一篇文章介绍了如何制作官方win10安装U盘(引起了很多朋友的关注。有一点安装经验的朋友应该或多或少听说过或见过使用某某PE大白菜、老毛桃等优盘装机。这些PE虽然它也可以为我们重新安装系统带来便利,但它还将携带...

2022-10-06

如何设定路由器密码-(如何设定路由器密码无线)

路由器密码如何设置?(路由器密码如何设置?无线)在装修或更换路由器时,我们总是要面对一个问题:密码太简单,很容易被黑客攻击「社工」甚至暴力破解,然后放慢互联网速度;设置太复杂,可能会让朋友在家里输入太头疼。毕竟,普通的网站密码有各种成熟的生成、存储和填...

2022-10-06

接路由器怎么弄-(摄像头连接路由器怎么弄)

如何接路由器?(摄像头连如何接路由器?)随着网络的发展,路由器已经成为我们网络生活中不可缺少的设备,那么如何设置新的路由器呢?接下来,小编会带你去探索。路由器分为硬路由和软路由,硬路由是外面买的普通路由器;软路由是x86是硬件基础的路由器,这里暂时不赘述比较复杂。硬路由分为有线路由和无线路由。...

2022-10-06

191路由网 - 192.168.1.1,192.168.0.1无线路由器设置教程

版权声明:本站的文章和图片来自互联网收集,仅做分享之用如有侵权请联系站长,我们将在24小时内删除