Ubuntu 14.04使用命令行安裝VirtualBox

Ubuntu 14.04使用命令行安裝VirtualBox


  • 基本安裝命令:

   

 #sudo sh -c 'echo "deb http://download.virtualbox.org/virtualbox/debian trusty contrib" >> /etc/apt/sources.list'
wget -q http://download.virtualbox.org/virtualbox/debian/oracle_vbox.asc -O- | sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 54422A4B98AB5139

    #sudo apt-get update

    #sudo apt-get install virtualbox-4.3


  • 中途遇到坑:

   

     遭遇報錯:    


        work@databackup:~/vbox$ sudo apt-get install virtualbox-4.3
        Reading package lists... Done
        Building dependency tree      
        Reading state information... Done
        virtualbox-4.3 is already the newest version.
        You might want to run 'apt-get -f install' to correct these:
        The following packages have unmet dependencies:
         virtualbox-4.3 : Depends: libgl1-mesa-glx or
                           libgl1
                  Depends: libqt4-network (>= 4:4.5.3) but it is not going to be installed
                  Depends: libqt4-opengl (>= 4:4.7.2) but it is not going to be installed
                  Depends: libqtcore4 (>= 4:4.8.0) but it is not going to be installed
                  Depends: libqtgui4 (>= 4:4.8.0) but it is not going to be installed
                  Depends: libsdl1.2debian (>= 1.2.11) but it is not going to be installed
                  Depends: libvpx1 (>= 1.0.0) but it is not going to be installed
                  Depends: libxcursor1 (> 1.1.2) but it is not going to be installed
                  Depends: libxinerama1 but it is not going to be installed
                  Depends: libxmu6 but it is not going to be installed
                  Depends: libxt6 but it is not going to be installed
                  Recommends: libasound2
                  Recommends: libpulse0 but it is not going to be installed
                  Recommends: libsdl-ttf2.0-0 but it is not going to be installed
                  Recommends: dkms but it is not going to be installed
                  Recommends: gcc but it is not going to be installed
                  Recommends: make
                  Recommends: binutils but it is not going to be installed
                  Recommends: pdf-viewer
                  Recommends: libgl1
           E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).


    解決方法:


         sudo apt-get purge virtualbox-4.3


    問題原因分析:


        懷疑是上一次安裝virtualbox不完整導致的問題。


  • 啓動xmanager passive


  • export DISPLAY=192.168.1.117:0.0


  • 加載虛擬機鏡像:


            Machine-->Add-->選擇虛擬機鏡像文件


  • 如果鏡像硬盤位置與之前不同,重新添加虛擬機硬盤時候會提示UUID重複問題,使用以下命令解決:


            vboxmanage internalcommands sethduuid /home/work/vbox/disk_win2008_sql.vdi


  • 添加extension pack包:


            file->preference...->extensions-->選擇要添加的 extension pack


發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章