How To Install Ubuntu On Virtualbox Mac

Virtualbox is a virtual machine software provided by Oracle company. It provide both Windows, Linux and MacOS version. This article will tell you how to install it’s MacOS version and install Ubuntu Linux virtual machine in virtualbox. It also tell you how to resolve some common issues when you use virtual machine with ubuntu OS for the first time like below.

  1. How to enable copy & paste between host and guest (ubuntu virtual machine) os.
  2. How to search and run ubuntu application.
  3. How to resolve can not ping guest (ubuntu virtual machine) os from host os error.

1. Install Virtualbox In MacOS.

  1. Download Virtualbox MacOS version.
  2. Click the download dmg file to install virtualbox. The process is very easy, just follow the instructions.

2. Install Ubuntu Virtual Machine In Virtualbox.

  1. Double click the virtualbox icon to open it.
  2. Click New button to create a virtual machine, input the virtual machine name and select Linux in the Type drop down list. Then select Ubuntu(64 – bit) in Version drop down list.
    create a new virtualbox virtual machine with linux type
  3. Click Continue button and specify the memory size, hard disk and storage information in the next wizard dialog.
  4. After all those steps, a new virtual machine has been created.
    virtualbox ubuntu virtual machine detail info
  5. Download ubuntu iso file and save it to a local folder.
  6. Right click the virtual machine, click Settings… menu item in the popup menu list, then click Storage button. Click the laser disk icon after Optical Drive label and click Choose Virtual Optical Disk File… menu item to select the downloaded ubuntu iso file.
    select ubuntu installation iso file to virtualbox viratul machine
  7. Now right click the virtual machine, then click Start —> Normal Start menu item to start ubuntu os installation.
    right click virtualbox virtual machine start normal to install ubuntu
  8. In the first install wizard, you can click Try Ubuntu button to try it from the iso file ( This action will not do any change to the virtual machine), or Install Ubuntu to install it in the virtual machine.
  9. In the next wizard just select the os language that you preferred.
    install ubuntu step2 - choose keyboard layout
  10. Choose Normal installation in the next wizard dialog if you are new to this.
    install ubuntu step3 - update and other softwares
  11. If you are a newbie, you can choose Erase disk and install Ubuntu radio button, this will use all default settings(partition settings etc) for this ubuntu os. If you have used other Linux version before, you can choose Something else radio button to customize the ubuntu os installation.
    install ubuntu step4 - installation type
  12. The last step is to specify a username and password for you to login ubuntu.
    install ubuntu step6 - create user account
  13. Now ubuntu has been installed correctly. Our version is ubuntu 18.04.1 desktop version. When you start it and login with your account, you can find it is stable like MacOS and it is easy to operate like Windows. In the next article, we will tell you how to configure SSH in the ubuntu OS and how to remote login into it.
READ :   How To Modify Hosts File In Mac

3. Run Application In Ubuntu.

When you want to run ubuntu applications, you can follow below steps.

  1. Click the Show Applications button at the left bottom of ubuntu desktop.
    ubuntu show applications icon
  2. Input application name ( for example : Terminal ) in the search box at top, then related application will be displayed at below. Click the application icon to start it.
    search ubuntu application by name

4. Enable Copy & Paste Between Host (Local Machine) And Guest (Virtual Machine) OS.

To enable copy and paste between host and guest OS, you need follow below steps.

  1. Start the virtual machine, and click Devices —> Insert Guest Additions CD image… menu item at top VirtualBox VM toolbar.
    virtualbox devices insert guest additions cd image
  2. Then it will mount a disk in the guest ubuntu virtual machine OS like below, it will prompt you to auto run it, click Run button and this will install the guest additions cd image.
    run virtualbox guest additions cd image automatically
  3. If you meet below error messages when click the Devices —> Insert Guest Additions CD image… menu item, this means the cd image has been mounted in the guest os already, so you just need to run it in the ubuntu virtual OS.
    Unable to insert the virtual optical disk /Applications/VirtualBox.app/Contents/MacOS/VBoxGuestAdditions.iso into the machine Ubuntu.
    Could not mount the media/drive ‘/Applications/VirtualBox.app/Contents/MacOS/VBoxGuestAdditions.iso’ (VERR_PDM_MEDIA_LOCKED).
  4. You can also run sudo apt-get install virtualbox-guest-utils command in terminal to install the guest additions support packages to enable copy & paste function.
  5. Now to enable Copy & Paste between host and guest OS, you also need to set shared clipboard configuration value in the vm general advanced settings.
  6. Right click the virtual machine in left panel and click Settings… menu item in the popup menu item list.
  7. Click General —> Advanced, then select Bidirectional menu item in both Shared Clipboard and Drag’n’Drop drop down list. Click OK to save the settings and restart the virtual machine, now you can copy and paste data between host and guest OS successfully.
    set virtualbox vm share clipboard, drag and drop configuration
READ :   How To Install SQLite3 On Mac

5. Resolve Can Not Ping Virtual Machine OS Issue.

Now the Ubuntu virtual machine has been installed and you have created an admin account for it. You can login to the system with that account. But when you want to access it from other machine, you should first find the ubuntu virtual machine’s external ip address with command ifconfig.

  1. Open a terminal in ubuntu, and run ifconfig command in it.
    [email protected]:~$ ifconfig
    enp0s3: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
    inet 192.168.0.107 netmask 255.255.255.0 broadcast 192.168.0.255
  2. If you get error message Command ‘ifconfig’ not found, you can run $ sudo apt install net-tools command to install it.
  3. The ip address after inet ( in red color ) is just the ip v4 ip address of this virtual machine.
  4. But when you ping this ip address from your host os, it will tell you request timeout error, this is because your virtual machine is not configured correctly.
  5. Open the virtual machine Settings dialog again, then click Network —> Adapter1. Change the Attached to value from NAT to Bridged Adapter. Then restart the ubuntu os, then you can ping the ubuntu os from host os.
    change virtualbox virtual machine network adapter type
(Visited 42 times, 3 visits today)

2 Comments


  1. You actually make it seem so easy together with your presentation but I to find
    this matter to be actually one thing which I feel I would by no means understand.
    It seems too complicated and very vast for me. I am taking a look ahead
    in your next publish, I’ll try to get the hold of it!

    Reply

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.