1. 程式人生 > >archlinux上安裝虛擬機器

archlinux上安裝虛擬機器

 一,介紹

  虛擬機器分提供軟體執行環境的虛擬機器和提供其他系統工作的虛擬機器。

  提供軟體執行環境的虛擬機器有:java虛擬機器,framework虛擬機器,android虛擬機器等;

  提供其他系統執行的虛擬機器有:vmware,virtual PC,virtualbox等;

  virtualbox是一款開源虛擬機器軟體,virtualbox是由德國Innotek公司開發,由Sun Microsystems公司出品的軟體,使用QT編寫,在Sun公司被Oracle收購後正式更名為Oracle VM VirtualBox。

  virtual PC全稱是windows virtual pc,是Microsoft公司最新的虛擬化技術,藉助windows virtual pc,可以單擊一次即可直接從基於windows 7的計算機在虛擬的windows環境中執行許多生產應用程式。

  vmware是公司的名字,vmware player是該公司免費的虛擬機器,vmware workstation是商業收費的虛擬機器。

二,宣告

  我們在下文中說的虛擬機器就是提供其他系統工作的虛擬機器,下文中簡稱為虛擬機器。

三,下載提前說明

  如果需要vmware,就去虛擬機器官網下載,但是需要註冊,另外有免費的,但是我也沒玩過,所以我這裡只提一下,安裝過程可參考官網虛擬機器安裝,不過他裡面的賬號密碼都不能用了。

  如果需要virtualbox,就可以參考下文,下文中也只用virtualbox。

四,下載

  方法1:

  a,下載

  因為我電腦是amd64位的,所以我使用

新浪科技的虛擬機器(amd64),如果你是IA64位的,你就用太平洋電腦網的虛擬機器(ia64),特別注意這裡都是64位的,只是採用的指令集不同。

我下載的是:VirtualBox-6.0.0-127566-Linux_amd64.run,此文以下內容都是用這個。

  b,安裝

  安裝必須要root,如下:

[[email protected] work]$ chmod +x VirtualBox-6.0.0-127566-Linux_amd64.run 
[[email protected] work]# su -
密碼:
[[email protected]
work]#./VirtualBox-6.0.0-127566-Linux_amd64.run Verifying archive integrity... All good. Uncompressing VirtualBox for Linux installation............. VirtualBox Version 6.0.0 r127566 (2018-12-18T12:40:58Z) installer Installing VirtualBox to /opt/VirtualBox Python 2.6 or later not available, skipping bindings installation. This system is currently not set up to build kernel modules. Please install the Linux kernel "header" files matching the current kernel for adding new hardware support to the system. This system is currently not set up to build kernel modules. Please install the Linux kernel "header" files matching the current kernel for adding new hardware support to the system. There were problems setting up VirtualBox. To re-start the set-up process, run /sbin/vboxconfig as root. VirtualBox has been installed successfully. You will find useful information about using VirtualBox in the user manual /opt/VirtualBox/UserManual.pdf and in the user FAQ http://www.virtualbox.org/wiki/User_FAQ We hope that you enjoy using VirtualBox. The installation log file is at /var/log/vbox-install.log.

發現一個問題:Please install the Linux kernel "header" files matching the current kernel

解決方法:網上關於redhat系列的都採用install kernel-devel,或者install kernel-header,亦或者install kernel-headers,反正在archlinux上就是不行,後來問人才知道,archlinux是install linux-headers。於是,如下:

[[email protected] work]# pacman -S install linux-headers
安裝過程省略...
[[email protected] work]# ./VirtualBox-6.0.0-127566-Linux_amd64.run 
Verifying archive integrity... All good.
Uncompressing VirtualBox for Linux installation.............
VirtualBox Version 6.0.0 r127566 (2018-12-18T12:40:58Z) installer
Removing previous installation of VirtualBox 6.0.0 r127566 from /opt/VirtualBox
Installing VirtualBox to /opt/VirtualBox
Python 2.6 or later not available, skipping bindings installation.

VirtualBox has been installed successfully.

You will find useful information about using VirtualBox in the user manual
  /opt/VirtualBox/UserManual.pdf
and in the user FAQ
  http://www.virtualbox.org/wiki/User_FAQ

We hope that you enjoy using VirtualBox.

之後會在軟體管理中心找到virtualbox的圖示,點選就可以使用了。

  方法2:

  問了人才知道,archlinux可以使用命令安裝virtualbox,

[[email protected] ~]$ sudo pacman -S virtualbox
這個方法推薦使用,但是我沒有用,因為我使用了方法1,不過方法1好像是有個東西需要安裝的,host什麼的,在這種命令安裝的時候會有提示的,可以注意比較一下。

第五,六步簡單說一下我的感受,網上的教程寫的都特別好,自己搜就是了。

 五,建立系統環境基礎

第四步中方法1(淡紫色)和2(藍色)完成安裝後的圖示是不一樣的,但是你可以在搜尋欄搜virtualbox就可以了。

開啟virtualbox,然後新建,接著就根據你的需要做就是了,方法2安裝之後相對智慧一點,可以根據你起的名字識別你要安裝系統。

六,啟動,加入系統

上面新建成功之後,就可以,啟動,然後新增系統的映象檔案,然後就是正常安裝過程了,如果沒有什麼更改的,所以預設操作就是了,和在正常電腦上安裝系統沒區別,或者說還好一點,因為虛擬的磁碟不需要擔心什麼問題。

參考1:https://zhidao.baidu.com/question/240557302.html

參考2:https://baike.baidu.com/item/VirtualBox/5842786?fr=aladdin

參考3:https://baike.baidu.com/item/Windows%20Virtual%20PC/7401753?fr=aladdin