Return to site

Virtualbox Ubuntu

broken image


Since the latest version of Ubuntu is 20.04 LTS, but I am showing you the installation of Ubuntu 18.04 on VirtualBox and my aim is to show you the process of installing Ubuntu. I hope you understand the process and install the latest version of Ubuntu as you want. Follow the instructions below to proceed. Can I install Ubuntu in VirtualBox on other Windows versions? Yes, you can install Ubuntu in VirtualBox on Windows 8, 8.1, and 7. In the past, I have not only installed Ubuntu but also Windows XP, 7, and Fedora on my Windows system. How to Install Ubuntu on VirtualBox in Windows 10 (2020) Download Oracle VirtualBox; Download Ubuntu OS ISO file.

In this post I'll show you how to install Ubuntu 18.04.3 LTS (Bionic Beaver) on Oracle's VirtualBox. I'll also demonstrate how to connect to the Ubuntu instance via SSH. This will form the basis for a second tutorial that will walk through installing and configuring Ruby on Rails on an Ubuntu server.

Let's get started!

What Is VirtualBox?

VirtualBox is a program that allows you to run multiple operating systems (guests) on one computer (the host computer). You may need to transfer files between the host and the guest. It's easy to set up in Windows guests, but tricky in Ubuntu guests. Here, we will see how to install VirtualBox guest additions on Ubuntu 20.04. Install Guest Additions On Ubuntu 20.04. VirtualBox guest additions are stored in an ISO image VBoxGuestAdditions.iso format inside the VirtualBox installation directory. To install the Guest additions, you need to mount the ISO image in your VM.

VirtualBox is a software virtualization package that you can install on your operating system (just as you would a normal program). It supports the creation and management of virtual machines into which you can install a second operating system.

In VirtualBox terminology, the operating system on which you install VirtualBox (i.e. your regular OS) is called the host. The operating system you install within VirtualBox (i.e. inside the virtual machine) is called the guest.

For this tutorial, I'll be using Linux Mint 19.2 as the host OS, but there's no reason you couldn't use a different Linux distro, or macOS, or Windows (if you're so inclined).

Install VirtualBox

The first thing to do is to get VirtualBox installed. I'll not go into much detail here, as there are comprehensive instructions for all of the main operating systems on the project's homepage.

Personally, I downloaded and installed the deb package for Ubuntu 18.04 / 18.10 / 19.04. This is because the VirtualBox version in the Mint repos is slightly outdated and I wanted to be running the latest version.

Download Ubuntu Server

The next thing to do is to grab a copy of Ubuntu Server. You can do this from their download page. This will download a 889MB iso file to your PC.

At the time of writing the current LTS version is Ubuntu Server 18.04.3 and this is what I'll be using. It's supported until April 2023 and is available as 64-bit only.

Create a New Virtual Machine

Start up VirtualBox. This should open the VirtualBox Manager, the interface from which you will administer all of your virtual machines.

Next Click on New (in the top right of the VirtualBox Manager), give your virtual machine a name and the two drop down menus should automatically update.

Click Next. The wizard will now ask you to select the amount of memory (RAM) in megabytes to be allocated to the virtual machine. I chose 2GB (2048 megabytes).

Click Next and you will be prompted to add a virtual hard disk to the new machine. Make sure that Create a virtual hard disk now is selected, then press Create.

Now we need to choose the file type for the new virtual hard disk. Make sure that VDI (VirtualBox Disk Image) is checked and press Next.

On the next screen you will be asked whether the new virtual hard disk should grow as it is used (dynamically allocated) or if it should be created at its maximum size. Make sure that dynamically allocated is selected, then click Next.

Finally, select the size of the virtual hard disk in megabytes. The default size of 10GB should be plenty, but feel free to increase this as you see fit. Juicebox pro 1 4 3 download free. Then click Create.

The hard disk should now be created and after a short while you should find yourself back in the VirtualBox Manager. You should be able to see your newly created virtual machine listed on the left.

Install Ubuntu Server in the Virtual Machine

Make sure your virtual machine is selected and press Start. VirtualBox Manager will ask you to select a virtual optical disk file or a physical optical drive to start the virtual machine from. Select the iso file you downloaded previously and press Start.

The Ubuntu installation process will now begin. It consists of thirteen steps and is quite painless.

The Welcome Screen

Here you should select your preferred language. I'm using English.

The Keyboard Configuration Screen

Here you should select a keyboard layout. As I'm using a German keyboard, I asked Ubuntu to detect my layout, which it did with a couple of simple questions.

The Network Connections Screen

Here Ubuntu will attempt to configure the standard network interface. Normally you can just accept the default and select Done.

The Configure Proxy Screen

If your system requires a proxy to connect to the internet (mine doesn't), enter its details in the next dialogue. Then select Done.

The Ubuntu Archive Mirror Screen

If you wish to use an alternative mirror for Ubuntu, you can enter the details here. Otherwise accept the default mirror by selecting Done.

The Filesystem Setup Screen

The installer can guide you through partitioning an entire disk or, if you prefer, you can do it manually. If you choose to partition an entire disk you will still have a chance to review and modify the results before Ubuntu is installed. I selected Use An Entire Disk.

I was then prompted to select my virtual machine's hard disk as the disk to install to, before being shown a summary of what the installer would do. As this is a 'destructive action'. I was asked to confirm my choice with Continue.

The Profile Setup Screen

Here you are required to enter:

  • Your (real) name
  • Your server's name
  • Your username
  • Password

Fill these details out as you see fit.

The SSH Setup Screen

Here we have a chance to install the OpenSSH server package. We'll need this to connect to the virtual machine via SSH later on, so ensure that you select it.

You also have the opportunity to import your SSH keys from GitHub or Launchpad. I selected No for this option.

The Featured Server Snaps screen

Here you can select from a list of popular snaps to install on your system. Snaps are self-contained software packages that work across a range of Linux distributions. I didn't select any.

And that's it, the installation is complete. Ubuntu will ask you to remove the installation medium (which you can do via Devices > Optical Drives > Remove disk from virtual drive > Force unmount) and then reboot.

If this option is grayed out, you're good to go. Just reboot.

Up and Running with SSH

Once your virtual machine has rebooted and you have logged in, you'll probably notice that some packages can be updated.

Let's fix that:

Now let's double check that SSH is installed (it should be if you selected the option Install OpenSSH server during instalation).

If you get a 'command not found' error, you can install it with:

The next step is to give our Ubuntu server an IP address on our local network. To do this, power off the virtual machine using sudo poweroff or Machine > ACPI Shutdown.

Then, in VirtualBox Manager, click on the Network panel on the right. Change the setting Adapter 1 > Attached to to 'Bridged Adapter' and click OK.

Start up your virtual machine, then enter ifconfig (in the guest) and note the IP address assigned to your main network adapter. In my case this was 192.168.178.66.

Note: it is also possible to stick with the original NAT interface and SSH into the guest using port forwarding. You can read more about that here. You can find information on all of the VBox network settings in this comprehensive guide.

Starting and Stopping VirtualBox in Headless Mode

You might have noticed, working with the VirtualBox Manager and the guest OS is a bit of a pain. If you're going to continue doing this, you should at least install the guest additions, as well as enable clipboard support.

There is a slightly nicer way however — you can start and stop the virtual machine using the VBoxManage command from your terminal.

To power on:

And to power off:

Where 'Ubuntu Server 18.04.3' is whatever you called your virtual machine (the name it has in the VirtualBox Manager GUI).

Connecting to the Ubuntu Server

Let's go ahead and start the Ubuntu server in headless mode, before connecting to it via SSH.

Note: The following commands should be run on your host.

On most *nix systems, the SSH client software should be part of the default installation. If you don't have it available, you should be able to grab it from the repos, like so:

or just hit DuckDuckGo.

Then (ensuring that you replace 'jim' and the IP address with your corresponding values) you can connect like so:

This will give you a warning that the host's authenticity cannot be established and ask you if you want to continue connecting. Answer 'yes'.

Next, it will prompt you for your password. Enter it and you will be connected to your Ubuntu server from your host OS.

For Windows Users

If you're running Windows you'll need to install a SSH client such as PuTTY.

When PuTTY starts, a window titled PuTTY Configuration should open. This window has a configuration pane on the left, a Host Name field and other options in the middle, and a pane for saving session profiles in the lower right area.

For simple use, all you need to do is to enter the IP address of the host you want to connect to in the Host Name field and click Open.

Generate and Install a SSH Key Pair

SSH keys offer a secure manner of logging into a server without the need of a password.

Virtualbox Ubuntu Screen Size

In a nutshell, this depends upon you generating a public and a private SSH key pair. The private key is kept on your PC (and should be guarded carefully). The public key is copied over to the server you wish to connect to.

SSH keys are a complex subject and as such, out of the scope of this tutorial. If you'd like to find out more, I recommend looking for a dedicated tutorial (such as this one).

Generate the Keys

On *nix systems (Windows users see the next section), you can generate your key pair with the following command:

The -o option instructs ssh-keygen to store the private key in the new OpenSSH format instead of the old (and more compatible PEM format). This is advisable, as the new OpenSSH format has an increased resistance to brute-force password cracking.

The -b option is used to set the key length to 4096 bits instead of the default 1024 bits for security reasons.

In the following dialogue you will be required to answer a couple of questions:

  • Where to save the newly generated key pair
  • Which passphrase to use

Here you can accept the default location and leave the passphrase blank by pressing Return.

ssh-keygen will then output a summary of what it has done:

Copy the Public Key to the Ubuntu Server

Virtual linux

To copy the public key to the Ubuntu server use:

Where ~/.ssh/id_rsa.pub is the path to your public key, taken from the output above. And where jim@192.168.178.66 should be altered to reflect your details.

The command will run and you should be asked for your server password. Enter it, then attempt to log into the server like so:

How To Run Ubuntu On Virtualbox

This time you should be in without a password.

For Windows Users

You should be able to use a tool like PuTTYgen to achieve the same thing. Dropshare 4 9 2 – secure file sharing tool boxes. Here is a tutorial on using PuTTYgen to create a new key pair for authentication.

You will have a little more leg work when it comes to copying the key to the server, where you will need to add the public key to a ~/.ssh/authorized_keys file.

You can do that like so:

This will create the appropriate file, then open the nano editor into which you can copy your newly generated public key.

When you're done, press Ctrl + X to save your changes and exit nano.

Conclusion

This has been quite a long post, but by the end of it you should have a working installation of Ubuntu Server running on VirtualBox that you can connect to from your host operating system via SSH.

As mentioned, this will form the basis for a future tutorial on deploying a Ruby on Rails app to an Ubuntu server.

If you have any questions or feedback, I'd be glad to hear your from you in the comments.

If you work on Windows and want to use Ubuntu without switching the system then it can be done. All you need to do is install Ubuntu on Windows. The good thing about the OS is it will run when it is asked to and it doesn't require any special partitioning of your disks.

In this post, we will guide you through steps to install Ubuntu on Windows 10 using Virtualbox

Must Read: What is Windows God Mode and How to Enable it on Windows 10

Before going further, you need to make sure that you have downloaded three applications

  • Oracle Virtualbox
  • Ubuntu
  • Virtualbox Guest Additions

Steps To Run Ubuntu Linux On Windows 10

1. Download Virtualbox:

First step is to download Virtualbox. You can download it from the link below.

2. Check Whether The System Is Of 32 Bit Or 64 Bit:

Before downloading and installing any of the application. You should know whether the system is 32 bit or 64 bit.

To check, follow the steps:

  1. Open Settings on your Windows 10 PC( Press Windows and I key together

2. Go to System-> About

3. Here, you can check if the system is 32 bit or 64 bit.

4. Download Ubuntu

Currently, there are two versions of Ubuntu:

  • Ubuntu 14.04.3 LTS
  • Ubuntu 15.04

You can download any of them. But downloading the older version will provide you longer support and downloading the new version will provide you with new features added.

3. Download Virtualbox Guest Additions

Guest Additions are used to make the Ubuntu virtual machine to work in full-screen mode at an appropriate resolution. To download it, click on the link below. Once you click the link, you will be directed to a page with a lot of links. Click on the link which matches with the version of Virtualbox you downloaded.

Must Read:After Windows and Mac, Its Linux OS on Ransomware Target!

4. Install Virtualbox

To install Virtualbox, follow these steps:

Image source: Lifewire.com

  • Go to Start and search for Downloads.
  • Once the Downloads folder is open, click on the Virtualbox application file.
  • Once the Virtualbox setup wizard comes up, click on Next to begin the installation.
  • On the next screen, you can choose the Virtualbox installation options.
  • You can choose the location where you want to install the file if not default.
  • Before finishing up, you can choose if you want to have a shortcut icon.

Image source: Lifewire.com

  • Now click on Install once the interface provides with the option.
  • Note: Before getting the option to install, a warning will appear stating that your network connection will temporarily be reset. If you don't want that to happen, click 'No' or if this is ok for you then click 'Yes'.

Image source: Lifewire.com

Image source: Lifewire.com

  • Once it is installed, you can start Virtualbox simply by leaving the 'Start Oracle VM Virtualbox after installation' checked and clicking 'Finish'.
  • To add Ubuntu, click on the 'New' icon on the taskbar.

Image source: Lifewire.com

  • You will be asked to name the virtual machine for your convenience.

Image source: Lifewire.com

  • Note: Select 'Linux' as the type and 'Ubuntu' as the version. Choose the correct version for it based on whether your machine is a 32-bit or 64-bit.
  • Next step would be choosing computer memory that you want to assign to the virtual memory. To do so, drag the slider to the amount you want to assign and click 'Next'.

Image source: Lifewire.com

5. Create a Ubuntu virtual machine

  • Now you will get an option to create Virtual Machine. Among three options to choose from, checkmark beside the option Create a virtual hard disk now and click on Create.

Image source: Lifewire.com Airradar 5 2 download free.

  • Next screen would ask you to set the space you wish to give to Ubuntu. Minimum space given is 10 GB. Choose the amount of space and click Continue.

Image source: Lifewire.com

  • With this step, the virtual machine is created but it has no OS.

Image source: Lifewire.com

Must Read:9 New Settings Features in the Windows 10 Creators Update

6. Install Ubuntu

Now that Virtual machine has been created, you need to boot into Ubuntu. To do so, follow the steps:

  • Click on Start button and locate the Ubuntu ISO file and click on the folder icon next to the 'Host Drive' drop-down.

Image source: Lifewire.com

  • Navigate to the download folder and click on the Ubuntu disc image and click 'Open'.
  • Now you will get the Ubuntu installer interface, click on Start to begin the process.
  • You will get options: Try Ubuntu or Install Ubuntu, click on the Install Ubuntu.
  • Next screen will show you the prerequisites like make sure that your machine has enough power or your laptop is plugged into power, system is connected to the internet, system should have over 6.6 gigabytes of disk space

Image source: Lifewire.com

  • Now, you will be asked to choose the option to install. As you are using a virtual machine, select the 'Erase disk and install Ubuntu' option. Click Install and then click on Continue on the next page.

Note: This act will not delete your hard disk but install Ubuntu in your Virtual hard drive.

Image source: Lifewire.com

  • You will get an option to choose the location where you reside, you can choose it on Map or type it in manually. Once done click on Next.

Image source: Lifewire.com

  • The last and final step is to create a user. Enter the name in to give your virtual machine a name. After that choose a username and enter a password to associate with that user.
  • Click Continue and it is done.

Image source: Lifewire.com

7. Install Virtualbox Guest Additions

The last task is to install the guest additions. To do so, please follow these steps:

Virtualbox

To copy the public key to the Ubuntu server use:

Where ~/.ssh/id_rsa.pub is the path to your public key, taken from the output above. And where jim@192.168.178.66 should be altered to reflect your details.

The command will run and you should be asked for your server password. Enter it, then attempt to log into the server like so:

How To Run Ubuntu On Virtualbox

This time you should be in without a password.

For Windows Users

You should be able to use a tool like PuTTYgen to achieve the same thing. Dropshare 4 9 2 – secure file sharing tool boxes. Here is a tutorial on using PuTTYgen to create a new key pair for authentication.

You will have a little more leg work when it comes to copying the key to the server, where you will need to add the public key to a ~/.ssh/authorized_keys file.

You can do that like so:

This will create the appropriate file, then open the nano editor into which you can copy your newly generated public key.

When you're done, press Ctrl + X to save your changes and exit nano.

Conclusion

This has been quite a long post, but by the end of it you should have a working installation of Ubuntu Server running on VirtualBox that you can connect to from your host operating system via SSH.

As mentioned, this will form the basis for a future tutorial on deploying a Ruby on Rails app to an Ubuntu server.

If you have any questions or feedback, I'd be glad to hear your from you in the comments.

If you work on Windows and want to use Ubuntu without switching the system then it can be done. All you need to do is install Ubuntu on Windows. The good thing about the OS is it will run when it is asked to and it doesn't require any special partitioning of your disks.

In this post, we will guide you through steps to install Ubuntu on Windows 10 using Virtualbox

Must Read: What is Windows God Mode and How to Enable it on Windows 10

Before going further, you need to make sure that you have downloaded three applications

  • Oracle Virtualbox
  • Ubuntu
  • Virtualbox Guest Additions

Steps To Run Ubuntu Linux On Windows 10

1. Download Virtualbox:

First step is to download Virtualbox. You can download it from the link below.

2. Check Whether The System Is Of 32 Bit Or 64 Bit:

Before downloading and installing any of the application. You should know whether the system is 32 bit or 64 bit.

To check, follow the steps:

  1. Open Settings on your Windows 10 PC( Press Windows and I key together

2. Go to System-> About

3. Here, you can check if the system is 32 bit or 64 bit.

4. Download Ubuntu

Currently, there are two versions of Ubuntu:

  • Ubuntu 14.04.3 LTS
  • Ubuntu 15.04

You can download any of them. But downloading the older version will provide you longer support and downloading the new version will provide you with new features added.

3. Download Virtualbox Guest Additions

Guest Additions are used to make the Ubuntu virtual machine to work in full-screen mode at an appropriate resolution. To download it, click on the link below. Once you click the link, you will be directed to a page with a lot of links. Click on the link which matches with the version of Virtualbox you downloaded.

Must Read:After Windows and Mac, Its Linux OS on Ransomware Target!

4. Install Virtualbox

To install Virtualbox, follow these steps:

Image source: Lifewire.com

  • Go to Start and search for Downloads.
  • Once the Downloads folder is open, click on the Virtualbox application file.
  • Once the Virtualbox setup wizard comes up, click on Next to begin the installation.
  • On the next screen, you can choose the Virtualbox installation options.
  • You can choose the location where you want to install the file if not default.
  • Before finishing up, you can choose if you want to have a shortcut icon.

Image source: Lifewire.com

  • Now click on Install once the interface provides with the option.
  • Note: Before getting the option to install, a warning will appear stating that your network connection will temporarily be reset. If you don't want that to happen, click 'No' or if this is ok for you then click 'Yes'.

Image source: Lifewire.com

Image source: Lifewire.com

  • Once it is installed, you can start Virtualbox simply by leaving the 'Start Oracle VM Virtualbox after installation' checked and clicking 'Finish'.
  • To add Ubuntu, click on the 'New' icon on the taskbar.

Image source: Lifewire.com

  • You will be asked to name the virtual machine for your convenience.

Image source: Lifewire.com

  • Note: Select 'Linux' as the type and 'Ubuntu' as the version. Choose the correct version for it based on whether your machine is a 32-bit or 64-bit.
  • Next step would be choosing computer memory that you want to assign to the virtual memory. To do so, drag the slider to the amount you want to assign and click 'Next'.

Image source: Lifewire.com

5. Create a Ubuntu virtual machine

  • Now you will get an option to create Virtual Machine. Among three options to choose from, checkmark beside the option Create a virtual hard disk now and click on Create.

Image source: Lifewire.com Airradar 5 2 download free.

  • Next screen would ask you to set the space you wish to give to Ubuntu. Minimum space given is 10 GB. Choose the amount of space and click Continue.

Image source: Lifewire.com

  • With this step, the virtual machine is created but it has no OS.

Image source: Lifewire.com

Must Read:9 New Settings Features in the Windows 10 Creators Update

6. Install Ubuntu

Now that Virtual machine has been created, you need to boot into Ubuntu. To do so, follow the steps:

  • Click on Start button and locate the Ubuntu ISO file and click on the folder icon next to the 'Host Drive' drop-down.

Image source: Lifewire.com

  • Navigate to the download folder and click on the Ubuntu disc image and click 'Open'.
  • Now you will get the Ubuntu installer interface, click on Start to begin the process.
  • You will get options: Try Ubuntu or Install Ubuntu, click on the Install Ubuntu.
  • Next screen will show you the prerequisites like make sure that your machine has enough power or your laptop is plugged into power, system is connected to the internet, system should have over 6.6 gigabytes of disk space

Image source: Lifewire.com

  • Now, you will be asked to choose the option to install. As you are using a virtual machine, select the 'Erase disk and install Ubuntu' option. Click Install and then click on Continue on the next page.

Note: This act will not delete your hard disk but install Ubuntu in your Virtual hard drive.

Image source: Lifewire.com

  • You will get an option to choose the location where you reside, you can choose it on Map or type it in manually. Once done click on Next.

Image source: Lifewire.com

  • The last and final step is to create a user. Enter the name in to give your virtual machine a name. After that choose a username and enter a password to associate with that user.
  • Click Continue and it is done.

Image source: Lifewire.com

7. Install Virtualbox Guest Additions

The last task is to install the guest additions. To do so, please follow these steps:

  • Click the settings icon on the VirtualBox toolbar.
  • Click storage option and then click on IDE

Image source: Lifewire.com

  • Now choose the small circle with plus sign in it to add a new optical drive.
  • You will get a prompt asking you to choose which disk to insert into the optical drive, 'Choose disk' button.
  • Locate the folder, where you have downloaded 'VBoxGuestAdditions' disc image and select Open. and then click OK to close the settings window.

Image source: Lifewire.com

  • Once you are back to the desktop, click on Start. Ubuntu will boot for the first time.
  • Note: You won't be able to use the virtual machine in full screen until the guest additions are installed properly
  • Click on the CD icon which is located at the bottom of the launcher panel on the left side and be sure that files are for VirtualBox Guest Additions.
  • Right click on an empty space where the list of files are and choose open in terminal.

Image source: Lifewire.com

  • Type the following into the terminal window:

Virtualbox Ubuntu 20.04

sudo sh ./VBoxLinuxAdditions.run

Must Read:How To Fix Proxy Settings In Windows 10 and 7

  • After running the command, you have to reboot the virtual machine.
  • Locate the little cog symbol in the top right-hand corner and click shutdown. You will get two options, shutdown & Choose 'Restart'.
  • As the virtual machine restarts choose the 'View' menu and select 'Full-Screen Mode'.
  • Click 'Switch' to continue.

Now, you are all set to use Ubuntu on your Windows 10 in full mode. Try it and let us know if you face difficulty while performing the steps.

What Do You Think?
0 Responses




broken image