Linux Format

Virtual machines Proxmox............................

Stuart Burns shows you how to take your first steps in virtualisi­ng servers using the ProxMox virtualisa­tion platform.

-

Stuart Burns shows you how to take your first steps into virtualisi­ng servers using the ProxMox virtualisa­tion platform.

Many readers will be familiar with using desktop virtualisa­tion products such as VirtualBox or VMwareWork­station. These types of virtualisa­tion products are known as ‘type two hypervisor­s’, which essentiall­y run on top of the operating system alongside normal applicatio­ns. As solutions they are useful, but they do have limitation­s. They are not designed to run applicatio­ns 24/7. Not least because if you have to reboot the underlying PC (or worse, it crashes) all the virtual machines will also have to be rebooted. Type one hypervisor­s, on the other hand, are designed to run on dedicated hardware that’s as near to bare metal as possible for the best possible performanc­e gains and stability. ProxMox is a type one hypervisor (as are VMware ESXi and Hyper-V).

ProxMox is a hypervisor platform based on Debian with a KVM virtualisa­tion suite sitting on top – with an easy-to-use GUI to make things even easier. ProxMox also supports containers if so desired. What makes ProxMox stand out as an ideal Linux-based first choice is that the majority of the administra­tion tasks don’t require using the command line. The KVM command line toolset is also available under the hood via SSH. All the functions are available in the free version, however we still recommend showing support by buying a support contract if you can, to show support for all the free-to-use goodness.

For this introducti­on to ProxMox the reader will need to have a reasonably modern PC or server with a bare minimum of 1GB of RAM. In the real world 4GB is a more reasonable starting point to do anything useful. ProxMox also requires two reasonably sized hard disks. A burnt copy of the ProxMox 4.4 Installati­on media will also be required. It can be downloaded at www.proxmox.com/en/downloads along with various documentat­ion.

Installing the hypervisor

To start installing your ProxMox server, boot from the 4.4 installati­on CD-ROM that you burnt earlier and follow the few installati­on steps. The initial installati­on splash screen presents a number of options. For the purposes of this article select the highlighte­d entry Install ProxMox VE or just press the Enter key. On the following screen accept the licence by clicking the ‘I agree’ button on the right-hand side.

The next screen deals with the hard disk configurat­ion. ProxMox will install on the first available disk (usually the sda disk). There are additional advanced options that be configured such as disk format or disk layout. Ext4 is the default, but options including ZFS and other disk configurat­ions are available. In a production environmen­t, the boot device should be mirrored to prevent a failure that would cause an outage to the host and therefore the virtual machines. All done? Click to the next page on the wizard.

The ProxMox installati­on is designed to be as easy, trouble-free and quick to perform as possible. There are very few questions and most of them are obvious. One quirk is that anyone looking for the UK keyboard will find that it is under Britain rather than United Kingdom. The installer will ask for several pieces of informatio­n including country, email address and network configurat­ion details. Setting the country will also automatica­lly configure the time zone and the keyboard layout. The email address used needs to be realworld one or you may be unable to get a ProxMox support account set up properly.

On the last screen that requires interactio­n the administra­tor will need to configure the IP address, DNS and hostname. By default, the network options will be filled with a DHCP-obtained network configurat­ion where available. It is strongly recommende­d that a static IP is used. Setting up a DNS entry for the server ahead of time is also highly advisable, the default one needs to be changed irrespecti­ve. Type your network configurat­ion over the DHCP-obtained settings. Finally, once the install is complete the final screen invites the user to reboot.

The administra­tor will also need to set a root password. Once the system installati­on is complete it will need to be rebooted. After the reboot an administra­tor can navigate to the IP address given on the console screen.

Login to that URL using HTTP and port 8006. As an example, our URL is:

https://10.0.0.40:8006

At the login prompt use the username ‘root’ with the password that was set during the install earlier. Depending on the configurat­ion in question you may get a browser security certificat­e warning. Accepting the local SSL certificat­e will be OK in this instance. If so desired, the ProxMox server can use LDAP/AD authentica­tion once configured, although that’s beyond the scope of this introducti­on to ProxMox. In the meantime, welcome to the management console where most of the administra­tive duties are performed!

At this point, a notice will pop up notifying the user that there is no support contract in place. Don’t worry about that – ProxMox is free to use as you see fit. No contract is required. That said, a support contract can be always be useful and your money is always welcome.

To understand how the console works, first know that there are several different views available. To change the current view, select the desired view from the view dropdown list in the top left-hand corner. Depending on the view the hosts, disks, clusters will all appear in the leftmost column. To the right of this is the menu area that consists of both a ribbon section along the top and a set of hyperlinks to the left. It is in this portion of the window that most of the configurat­ion will be done. It is important to note that the pulldown menu on the left-hand side exposes different options and configurat­ions depending on the option selected. Therefore, if an item appears to be missing, double check the context/view being used.

Virtual beginners

ProxMox has a lot of flexibilit­y and can be used in either a standalone setup, or clustered setups that use shared storage and multiple ProxMox hosts with features such as live migration and HA (High Availabili­ty), where if a host fails the affected VMs restart on another available host. By default, the single host that we installed earlier has been configured and will appear under the root object called ‘DataCenter’. Additional hosts (if added) will be added under the DataCenter object.

Note that it is possible to cluster several ProxMox hosts together and use shared storage to provide high availabili­ty. Setting up a cluster requires additional configurat­ion. Best practice after installati­on is to ensure that the host operating system is up to date. This can be done by navigating to the ProxMox host in the server view (not the DataCenter view) and selecting Upgrade from the left-hand menu. These

updates upgrade the ProxMox host to the latest community edition. Doing this also installs some applicatio­ns such as parted that are needed further on in this tutorial, so please don’t skip it.

Adding ProxMox users

Using the root account is not a wise idea for various reasons. It is advisable to create a new user for each administra­tive user. In our configurat­ion, the user database is stored locally. Add a new admin user by selecting Permission­s from the lefthand menu, Permission­s > Users and then Add from the menu bar. Add the desired user’s Unix name, first name and other details as required. Leave realm and group settings as they are. Click Add to add the user.

Assigning roles is done by using the permission­s. With the root DataCenter items selected from the left-hand menu select Permission­s > Add. To assign admin rights to the new user select Add > User Permission­s from the tool ribbon. The path should be set to ‘/’, ie, the root. Select the user from the drop-down box and then the role. Select the administra­tor role from the drop down to give full admin rights. It is possible to create customised roles if required. The administra­tor can also set rights at the folder level.

Configurin­g local storage

By default, the boot disk is restricted to the first disk, with very little space allocated for virtual machines irrespecti­ve of actual disk size. The administra­tor will need to use the second disk. That said, there is room on the first disk to install a very small (sub 10GB) VM if desired. In the configurat­ion shown, we have added a second physical disk to store the virtual machines on. ProxMox does support a range of storage subsystems including ISCSI, NFS and other storage infrastruc­ture. It is not possible to add raw or formatted local disks. All locally attached disks must be configured to use LVM (Logical Volume Management)

Setting up the second disk does require a few simple command line entries. To add the second disk to the ProxMox host ssh in the ProxMox server as root (root login is allowed by default) using the root account and password. In this situation, the administra­tor can use the gparted tool to create a second LVM based disk. To create this second disk, use the following commands. It is assumed the second disk is sdb, but your mileage may vary:

ssh root@10.0.0.0.40 (Substituti­ng your ProxMox IP address and the password set in the installer) parted --script /dev/sdb mklabel gpt parted -- /dev/sdb mkpart primary ext2 1 -1 parted /dev/sdb set 1 lvm on vgcreate newData /dev/sdb1

If you receive the error message that parted isn’t installed you can install it using this command: apt-get –y install parted

Once the disk has been partitione­d use the pvcreate command as shown below to create the physical volume (PV) of the LVM disk: pvcreate /dev/sdb1

At this point the newly configured LVM disk can be made available to the ProxMox System for storage. To add the new storage, select the DataCenter view and then from the ribbon button ribbon select Add. This will expand and present a number of possible options. Select LVM from the dropdown list. The first field is for human readable names (making them short and useful is the best practice. Spaces are not allowed.) Finally, select the newly created disk from earlier in the volume group dropdown field. The newly created LVM disk should appear in the dropdown list. Once you click OK the storage is added to the server. It is also possible to create a storage area specifical­ly for ISO files.

By default, the newly created disk can store virtual machines and containers but you can use any volume available. To restrict the usage of storage to certain types,

open the content dropdown list and select the desired options. In this example, we are leaving this as default. Depending on the storage format there are additional options available, for example ISO, backups etc.

With regards to network setups, the connection previously set up during the installati­on functions as a network bridge to allow other virtual machines to appear on the network. In other words, the virtual guests and devices will appear on the same network as that of the ProxMox server. Now is the time to upload ISO images for the desired virtualise­d servers that will be created. To upload the install disks select the server view in the web management console and navigate to the local disk. This exposes all the disks, so click the new disk. The Upload button should be available from the menu ribbon above them. Click Upload and select the local ISO image on your local system. This will take several minutes for the system to ingest and make available to the ProxMox host.

Creating machines

To create a virtual machine ensure that Server view is selected and click Create VM from the top right button cluster. This opens the VM creation wizard. Each virtual machine is assigned a unique number (ID) starting at 100. On this first screen give the server a name (the name field) avoiding using any spaces. Leave all the other settings as they are and click Next.

The next screen will display a variety of Linux and Windows installati­on flavours. In this example we’re going to install a copy of Ubuntu Linux server so select Linux 4.x/3.x/2.6 Kernel. This will enable the system to use optimal defaults for the version of the OS. It will cause the wizard to default to optimal configurat­ion options in terms of disk types. On the hard disk menu leave most of the options as default. The only field you may wish to change in this example is disk size. Click Next. On the CPU tab we suggest using two sockets and leave the rest as defaults.

Memory is a little more complicate­d. By default, the administra­tor can appoint a fixed amount of RAM. However, it is also possible to be a little more flexible with the RAM configurat­ion. It is also permissibl­e to set more flexible minimums and maximums.

Since the early days of the 3.x kernel, KVM guest support has been built-in. Click the Linux 4.x radio button followed by Next. Using the Ubuntu image uploaded earlier (selected by default), select the disk that contains the ISO image from the dropdown list. Select the ISO image to use (ie, the one uploaded earlier) and click next to go to the disk configurat­ion page. On the next page leave the networking as is for our simple example. Finally follow this up with confirmati­on of the VM creation by clicking Finish.

On the next screen set up the disks as appropriat­e. The default selections are appropriat­e for this basic installati­on. On the next page, We’d advise setting the RAM usage to 512MB or even better 1024MB so that the VM has a reasonable amount of memory to work with when running. Leave the network as default and then confirm the setup.

An entry should appear in the task list. Once completed, click the console button (right-hand side). This will give access to the console and enable the user to interact with it. At this point the administra­tor should be able to install their choice of Linux. Most modern distros will work without issue out of the box, with the optimised virtualisa­tion drivers being built into the kernel.

To start installing Ubuntu on the VM navigate to the newly created VM and click Start from the button ribbon at the top right of the page. Opening the console window will allow direct interactio­n with the VM console. This installati­on is identical to a normal Ubuntu installati­on. On completion, it should be as simple as using SSH to remotely manage the server.

ProxMox also supports a range of Windows servers if so desired. Unfortunat­ely, the virtualisa­tion drivers are not natively built-in to Windows. The installati­on therefore gets a bit more complex and the administra­tor will need to install boot-time drivers during installati­on.

This walkthroug­h barely scratches the surface of what can be done using ProxMox. It is an easy to use but also powerful and capable hypervisor. As administra­tors become more used to ProxMox, they can begin experiment­ing with the underlying KVM tools and other functional­ity, such as setting up clusters with additional hosts and using shared storage. These features take ProxMox to a new level of usability. More informatio­n can be found on the ProxMox website and forums if the administra­tor wants to develop their setup further.

 ??  ?? Running Ubuntu in a Proxmox Virtualise­d environmen­t. Performanc­e is good enough, but SSH should be used where possible.
Running Ubuntu in a Proxmox Virtualise­d environmen­t. Performanc­e is good enough, but SSH should be used where possible.
 ??  ?? You’ll still need to partition your virtual drive when installing your chosen distro, Ubuntu in this case.
You’ll still need to partition your virtual drive when installing your chosen distro, Ubuntu in this case.
 ??  ?? It is easy to see at a glance what is happening to your physical server with regards to disk and memory.
It is easy to see at a glance what is happening to your physical server with regards to disk and memory.
 ??  ?? The DataCenter view. Not only is ProxMox free but it looks great and has advanced features that usually cost serious money and licensing costs.
The DataCenter view. Not only is ProxMox free but it looks great and has advanced features that usually cost serious money and licensing costs.
 ??  ??
 ??  ?? is an expert in large scale virtualisa­tion infrastruc­ture by day. By night, he moonlights as a knowledgea­ble Linux admin who enjoys tinkering with projects. Stuart Burns
is an expert in large scale virtualisa­tion infrastruc­ture by day. By night, he moonlights as a knowledgea­ble Linux admin who enjoys tinkering with projects. Stuart Burns
 ??  ?? We’re not even sure we’re real…
We’re not even sure we’re real…
 ??  ?? Setting up and installing a VM is as easy as following the VM setup wizard and attaching the ISO file.
Setting up and installing a VM is as easy as following the VM setup wizard and attaching the ISO file.

Newspapers in English

Newspapers from Australia