Skip to content

Instantly share code, notes, and snippets.

@33eyes
Last active January 5, 2018 05:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save 33eyes/53471806210506fdbd32c80d59ff63b0 to your computer and use it in GitHub Desktop.
Save 33eyes/53471806210506fdbd32c80d59ff63b0 to your computer and use it in GitHub Desktop.
Setting up Ubuntu Vitrual Machine on Windows 10 64-bit host PC

Setting up Ubuntu Virtual Machine on Windows 10 64-bit host PC

Note: After many of the steps below, at least the virtual machine needs to be restarted, and sometimes I had to restart VirtualBox and the host machine. So it's a good idea to restart the VM often, and if some setup changes didn't go through etc, try to restart VM/VirtualBox/host machine first when troubleshooting.

Another note: The setup/istallation steps can vary greatly depending on host machine hardware/OS/network. The steps outlined here won't work for every possible case.

  1. Download VirtualBox (it's free)

  2. Install VirtualBox - install it just like a regular application, just follow the prompts in the installation wizard.

  3. Download an .iso of whatever Ubuntu version you need. I had to use a 32-bit version of Ubuntu, because while my laptop is 64-bit and runs 64-bit Windows OS, it has old hardware that can't support a 64-bit virtual machine (https://askubuntu.com/questions/675251/virtualbox-has-no-64-bit-options). I went with Ubuntu 17.04 (Zesty) 32-bit Desktop version, and got it here: http://mirror.pnl.gov/releases/zesty/ .

  4. Create a new virtual machine, configure it for Ubuntu, and install Ubuntu on it:
    Note: Change the 10MB hard disk space limit to something larger, the 10MB default setting will probably be too small, and it's harder to change it later.

  5. Install guest additions

  6. Set up shared clipboard and file drag & drop

    • shut down the virtual machine, and click on Settings for that machine
    • in the General tab, go to Advanced
    • select Bidirectional for Clipboard and Drag & Drop
    • now you should be able to copy/paste between the host and guest machines, and also drag & drop files between them.
  7. Set up the network/internet (if it's not working as it should already)

    • this can be tricky, and I got stuck here for a bit.
    • I had the Ubuntu guest network adapter set to NAT (which was the default)
    • Make sure that the network adapter is enabled:
      • shut down the VM and go to its Settings > Network
      • make sure that Enable Network Adapter checkbox is checked, and that Attached to: drop-down is set to NAT.
    • Make sure that the network adapter is connected:
  8. Set up DNS service on your Ubuntu guest

    • Run the following commands in Ubuntu guest terminal:
    sudo su
    echo "nameserver 8.8.4.4" >> /etc/resolv.conf
    echo "nameserver 8.8.8.8" >> /etc/resolv.conf
    exit
    

    (source: https://superuser.com/questions/648396/virtualbox-ubuntu-can-not-connect-to-internet)

    • to figure out why I couldn't connect to the internet (either by pinging www.google.com in terminal, or trying to reach it on Firefox), I used the following code, and it helped me narrow down the problem to a lack of DNS service setup:
    ping -c 3 127.0.0.1    # to local host
    ping -c 3 192,168.0.24    # to it's own NIC
    ping -c 3 -R -v 192.168.0.1    # to the gateway, Record route and get verbose ICMP
    ping -c 3 8.8.8.8    # to numeric IP at google
    ping -c 3 www.google.com  # to google through dns
    

    (source: https://ubuntuforums.org/showthread.php?t=2315258)

Other references I used:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment