Ubuntu16.04环境下VirtualBox+Vagrant虚拟环境的安装

安装VirtualBox

下载地址:https://www.virtualbox.org/

1. 使用上述下载地址下载最新版本VirutalBox,截至到文章当前时间为:5.2版本。

image

2. 选择需要使用的系统相应版本的安装文件。这里选择Linux版本。

image

相应的选择红色标记的版本:

image

3. 执行如下命令进行安装:

下载文件virtualbox-5.2_5.2.6-120293_Ubuntu_xenial_amd64.deb存放在:/home/yitian/Desktop/目录下。

yitian@ubuntu:~/Desktop$ sudo apt-get install libqt5x11extras5 libsdl1.2debian

yitian@ubuntu:~/Desktop$ sudo dpkg -i virtualbox-5.2_5.2.6-120293_Ubuntu_xenial_amd64.deb

4. 验证VirtualBox安装完成

yitian@ubuntu:~/Desktop$ virtualbox -help
Oracle VM VirtualBox Manager 5.2.6
(C) 2005-2018 Oracle Corporation
All rights reserved.

Usage:
   –startvm <vmname|UUID>    start a VM by specifying its UUID or name
   –separate                 start a separate VM process
   –normal                   keep normal (windowed) mode during startup
   –fullscreen               switch to fullscreen mode during startup
   –seamless                 switch to seamless mode during startup
   –scale                    switch to scale mode during startup
   –no-startvm-errormsgbox   do not show a message box for VM start errors
   –restore-current          restore the current snapshot before starting
   –no-aggressive-caching    delays caching media info in VM processes
   –fda <image|none>         Mount the specified floppy image
   –dvd <image|none>         Mount the specified DVD image
   –dbg                      enable the GUI debug menu
   –debug                    like –dbg and show debug windows at VM startup
   –debug-command-line       like –dbg and show command line window at VM startup
   –debug-statistics         like –dbg and show statistics window at VM startup
   –no-debug                 disable the GUI debug menu and debug windows
   –start-paused             start the VM in the paused state
   –start-running            start the VM running (for overriding –debug*)

Expert options:
   –disable-patm             disable code patching (ignored by AMD-V/VT-x)
   –disable-csam             disable code scanning (ignored by AMD-V/VT-x)
   –recompile-supervisor     recompiled execution of supervisor code (*)
   –recompile-user           recompiled execution of user code (*)
   –recompile-all            recompiled execution of all code, with disabled
                              code patching and scanning
   –execute-all-in-iem       For debugging the interpreted execution mode.
   –warp-pct <pct>           time warp factor, 100% (= 1.0) = normal speed
   (*) For AMD-V/VT-x setups the effect is –recompile-all.

The following environment (and extra data) variables are evaluated:
   VBOX_GUI_DBG_ENABLED (GUI/Dbg/Enabled)
                              enable the GUI debug menu if set
   VBOX_GUI_DBG_AUTO_SHOW (GUI/Dbg/AutoShow)
                              show debug windows at VM startup
   VBOX_GUI_NO_DEBUGGER       disable the GUI debug menu and debug windows

安装Vagrant

在Vagrant官网上下载最新版本的安装文件,下载地址:https://www.vagrantup.com/downloads.html

image

选择:vagrant_2.0.2 -> vagrant_2.0.2_x86_64.deb进行下载。这里下载的最新版本的文件为:vagrant_2.0.2_x86_64.deb。

使用如下命令进行安装:

yitian@ubuntu:~/auroraclone/aurora$ sudo dpkg -i /home/yitian/Desktop/vagrant_2.0.2_x86_64.deb 
[sudo] password for yitian: 
(Reading database … 182040 files and directories currently installed.)
Preparing to unpack …/vagrant_2.0.2_x86_64.deb …
Unpacking vagrant (1:2.0.2) over (1.8.1+dfsg-1) …
Setting up vagrant (1:2.0.2) …
Processing triggers for man-db (2.7.5-1) …

yitian@ubuntu:~/auroraclone/aurora$ vagrant -v
Vagrant 2.0.2
yitian@ubuntu:~/auroraclone/aurora$

查看Vagrant版本信息,此时为最新版。完成!

常见问题

不要使用如下命令进行安装:

sudo apt-get install vagrant

使用上述命令完成的Vagrant安装并不是最新版本,因此会出现VirtualBox和Vagrant版本不一致导致的异常。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值