13Apr/170

Installing Windows Hyper-V 2016 on a dedicated server

Welcome to our tutorial about installing Hyper-V on your Dedicated Server with Windows Server 2016.

Step 1

Installing Hyper-V

After receiving the login information to your dedicated server you might want to find out how Hyper-V can be installed. Hyper-V is an additional Server-Role for Windows which can be added within the Server manager.

On the upper right side you will find the option "Add Roles and Features"

 

After clicking on that option a new windows will popup.

Navigate to "Server Roles" and select Hyper-V

Now select the checkbox and click on next.
You will be asked if the install manager is allowed to automatically reboot your server.


At least one reboot is required !

The installation can take up to one hour, depending on the rented dedicated server model and the storage configuration it might be completed within several minutes.

 

 

Step 2

Configuring Hyper-V

For configuration we are going to use the Hyper-V Manager, you can access this tool by clicking on "Tools" on the upper right side within your Server-Manager window.

Before creating a virtual machine, we have to configure the network interface. Open the "virtual Switch Manager" to perform the necessary steps.

Now we are going to create a new external switch:

Enter a name and description (notes) of your choice.

Select the external network and make sure that the checkbox "allow management operating system to share this network adapter" was selected. If it was not selected your server might be inaccessible afterwards.

Step 3

Configuration of the Network

On the taskbar at the very right side you will see the network icon.
Perform a rightclick to open the following dialogue:

Another window will open, navigate to your network devices:

Now rightclick on the recently created network device and select "Properties":

Select "Internet Protocol Version 4" and once more select "Properties"

Insert your Server's IP-Configuration.

Please double check the information you are setting up, otherwise your server will be inaccessible.

Step 4

Creating a virtual machine

For now we are almost done, the next step shows you how to create a virtual machine.

Within the Hyper-V Manager select "New" to create a new VM:

Configure the VM with your preferences:

Tip: Selecting "Generation 2" for Windows 8 (Windows Server 2012) VMs and later will improve the performance.

As network device you should select the Hyper-V Switch we have created before.

Select the .ISO you want to install and start the installation.

After the installation was completed you need to set up a public IP within the VM.
If you do not have any additional public IPs assigned to your account, please contact us at support@contabo.com to order additional IPs.

After a public IP was set up, your VM will be able to establish connections.

8Sep/160

Comparison of the different Linux distributions available at Contabo

As a valued customer of Contabo you have access to a variety of different Linux distributions, for use on all of our servers. These can be easily and automatically installed via our powerful customer control panel, which results in various benefits for our customers:

- Contabo always provides the latest versions for installation on all servers.

- You can conveniently and comfortably choose and switch between the offered Linux distributions at any time.

- All Linux distributions are offered free of any costs or fees.

- From the beginner towards the enthusiast, up to commercial professional use, all requirements can be met with the distributions offered by Contabo.

CentOS:

CentOS (Community Enterprise Operating System) is a Linux distribution based on Red Hat Enterprise Linux (RHEL). It is maintained by an open group of voluntary developers, which take care of maintenance and development. As opposed to RHEL, you can use this operating system without mandatory support contracts and free of charge.

WHMs cPanel is developed for this operating system in particular, which makes this Linux distribution a must have for resellers. As an enterprise operating system it is developed with stability and long-term maintenance cycles in mind. All CentOS versions can be used for 10 years without the need to migrate packages and software versions, which makes it an ideal solution for commercial use.

https://www.centos.org/

Debian:

Debian is another Linux distribution that is composed completely of free software, most of which is under the GNU General Public License.

Long term support was first introduced with version 7 for almost all available software packages that use the architectures i386 and AMD64 (32bit- and 64bit-PC-systems). The Debian Project aims to provide 5 years long-term support with security and bug fixes for all versions from 7 upwards. This Linux distribution has access to online repositories that contain over 50,000 software packages, making it one of the largest software compilations available. Debian officially contains only free software, but non-free software can be downloaded and installed as well if needed. This makes it a valid solution for commercial use, as well as a versatile operating system for the regular user.

https://www.debian.org/

Ubuntu:

Ubuntu is a Linux distribution that is strongly based on and influenced by Debian. The goal of the developers was to create an operating system that is as easy to use as possible. It is one of the most commonly used distributions available today. The development team also releases long term support versions of Ubuntu, which are indicated by “LTS” at the end of the version number.

http://www.ubuntu.com/

OpenSUSE:

The focus of its development is creating usable open source tools for developers and administrators, while providing a user friendly desktop and server environment. A unique feature of this distribution is its specialized installation and configuration tool YaST (“Yet another Setup Tool“), which is a central administrative tool for the OpenSUSE operating system. It also helps finding new software and packages for the OpenSUSE distribution.

https://en.opensuse.org/Main_Page

Fedora:

Compared to other Linux distributions, Fedora does not aim for long term support. The life cycle of a Fedora version is 13 months only. Every 6 months a new version is released by the development team. Owing to this circumstance, Fedora is not suited for long-term usage on systems.

On the other hand, you have always access to the latest software developments available. Being state of the art has never been this comfortable. Enthusiasts that are eager to try out the latest developments on the market should always consider using Fedora.

https://getfedora.org/en/

Posted by: Philipp | Tagged as: , , , , , , No Comments
24May/160

Changing the partition layout of your VPS after installation

Sometimes, it is necessary to change your partition layout in order to create new partitions or extend an existing partition, for example after a VPS upgrade.

This tutorial shows how to easily change your partition layout on your VPS.

Please be advised to perform a backup of all important data before proceeding ! Changes to the partition table always bear the risk of complete data loss.

Linux


Step 1:

Boot your VPS into the rescue-system, this can be done within your customer control panel.

You will need to connect through VNC.

After you have established a connection login as "root".

Step 2:

To perform changes on the partition easily we are going to use gparted.

If you want to boot your system straight up into your regular OS after repartitioning, you should execute "exitrescue" now on the commandline before proceeding.

To start the GUI type "startx" within your VNC console and wait a few seconds until the graphical interface appears.

On the upper left side you will see "Applications", open it and select "Run Program".
Now type "gparted" within the application finder and the app should start immediately.

part1

 

 

 

 

 

 

 

 

 

 

Step 3:

You should find an overview of all existing partitions on your hard disk drive.
In case there is no unused space left,  we need to shrink one existing partition first, otherwise we will not be able to create a new one.

After a right click on the corresponding partition and choosing "Resize/Move", the partition can be either shrunk or extended.

Please note that LVM partitions (which are used with CentOS by default) cannot be shrunk!

part3

In case you only wanted to extend your existing partition, please proceed with step 5.

Step 4:

Creating new partitions on the recently freed up/already free storage.

part4
Perform a right click on the unallocated space and select "new" to create a new partition.

In this case I did it twice to create two additional partitions.

part5

Step 5:

So far, no actual changes have been made on your hard drive. If you want to restart the partitioning just rerun the gparted tool.

To write the changes to the HDD hit the green tick symbol.
After hitting the tick, a warning will appear saying that you can lose all data - you should have a backup, so no worries.

 

part6

 

The application should start performing several tasks, just wait until it has finished.

Depending on the size of the partition and the data stored on it, this will take its time.

 

part7

 

Step 6:

You are done, just boot up your VPS into the regular OS  and check if everything is as expected:

root@contabo-test:~# fdisk -l

 

Windows


Step 1:

Connect to your server using RDP.

Step 2:

Open the "Disk Management", this can be done with a right click on the Windows Icon on the lower left side.
You could also start it by opening the "run" prompt, which can be done  via "Start" -> "Execute" -> "diskmgmt.msc", alternately the "Execute" dialogue can be opened by hitting "Windows-Logo-Key +R"

winp1_en
Step 3:

After the Windows "Disk Management" utility was started you will see an overview of all installed harddrives.
On a VPS you will usually have one drive, on a dedicated Server you will probably have more than one sparse disk.
Search for the disk you want to repartition and perform a right click on the partition you want to resize.

You can shrink and also extend a Volume, sometimes when upgrading your VPS to a bigger plan you can either create a second partition or just extend the existing partition.

For now we want to shrink the existing partition, so we hit "Shrink Volume".

winp2_en
Step 4:

After some time passed you will see a popup, just fill out the field with the amount of space you want to free up and hit "shrink".

winp3_en

After shrinking you will have unallocated space, now you are ready to create a new partition, e.g. a FAT32 filesystem etc.

winp4_en

Posted by: Gianni-Donato | Tagged as: , , , , , , , , No Comments
14Sep/150

Many helpful tutorials available at Contabo!

Time and again you, our valued customers, contact us with questions regarding the administration of your server or system. Often, your inquiries cannot be answered quickly as either a thorough answer is required, including several process steps, or a detailed preparation is necessary on our part. Now we have collected all the interesting questions that we have been dealing with in our customer support service and answered them in detail (often with screenshots attached for a better understanding).

You can access these so-called tutorials through the button „Tutorials“ on the bottom information-bar on our website, or directly via tutorials.contabo.com. There you will find instructions, solutions and hints which will simplify your life just as well as the handling of your hosting products.

Of course we constantly strive to expand this newly created area of our website.
Now... If you have got a specific question or are interested in a general topic regarding the administration of a server or system, but cannot find a proper answer anywhere...
Just let us know via e-mail at support@contabo.com. We will collect your suggestions and from time to time our technicians will post new topics. Isn't it another great reason for you to access Contabo.com on a regular basis – now also including tutorials.contabo.com?

Posted by: Markus | Tagged as: , , , , No Comments
19Jun/150

Mounting of additional hard drives in Windows

In this tutorial, we are going to mount an additional hard drive in Windows. As you may notice, we will do so in Windows Server 2012, but the procedure is basically the same with Windows Server 2008.

At first, we need to open a menu by right-clicking the Start button:

_2015-05-28_18-14-12

We must select Disk Management to open the Disk Management service. If Windows identifies a new hard drive, a pop-up menu opens:

mbrgpt

For volumes smaller than 2 TB, we choose MBR, for larger disks, we select GPT. As the hard drive in our example only has a capacity of 100 GB, we'll go with MBR here. By clicking OK, the chosen partition table will be written to the hard disk. After that procedure, we will be sent to the main menu of the Disk Management service. Alternatively, one can reach this overview via Control Panel => Computer Management.

haupt

As we can see here, our new hard drive is listed as Disk 1. But before we can use it for storing data, we need to partition and format it. Therefore, we right-click the rectangle next to the box which says Disk 1 and choose New Simple Volume.

haupt2

A wizard opens. It is quite self-explanatory and you can't do anything wrong by using the pre-selected and suggested values. Per default, the wizard uses the whole disk capacity for the new partition and formats it with the file system NTFS, which is recommended for Windows. Of course, you are free to change those settings, but in our example, we go along with them.

ntfs

The name of our new partition is STORAGE, but of course you can name it as you wish.

Once you went through the wizard, the new hard drive will be ready to use. It will also be visible in the Explorer:

explorer

5Nov/130

LAMP made easy

Logo_LAMPWe would like to make you aware of a novelty in our ASI. Some of you may have noticed already that we had implemented an additional LINUX option called LAMP some time ago.

This option is available from our website when ordering a VPS or dedicated server, that runs under either LINUX operating system CentOS, Debian and Ubuntu.

By that additional option, you will - with the aforementioned LINUX distributions - be provided with a complete webserver environment. In addition to the LINUX operating system (L) you will receive an installation of Apache 2(A), MySQL (M), and the commonly known script language PHP (P).  PHPMyAdmin tool is equally installed, to simplify the administration.

In order to establish a website it is necessary for the domain to resolve to the IP of the server. At first, please activate the default website.

a2dissite default
a2dissite default-ssl
service apache2 reload

To save the change you will have to reload the configuration finally. Now establish a configuration file for a virtual host in the following library: /etc/apache2/sites-available let's call it:  example.com

<VirtualHost *:80>
ServerAdmin your.email@example.com
ServerName example.com
ServerAlias www.example.com
DocumentRoot /var/www/example.com/public_html/
ErrorLog /var/www/example.com/logs/error.log
CustomLog /var/www/example.com/logs/access.log combined
</VirtualHost>

Creating the required directories:

mkdir -p /var/www/example.com/public_html
mkdir /var/www/example.com/logs

Sure enough, this new website needs to be activated now by creating a link to the configuration file in library: /etc/apache2/sites-enabled

a2ensite example.com
service apache2 reload

A phpinfo.php file is helpful to check if PHP is working correctly:

cat > /var/www/example.com/public_html/phpinfo.php << EOF
<? phpinfo(); ?>
EOF

If the webserver fails to start or refuses to read the configuration, it is always a good idea to check the logfiles for any errors. They are mostly located in  /var/log/apache2/*.  To be sure, you can check the configuration with the command /usr/sbin/apachectl configtest before restarting the webserver.

We would like to help the enthusiasts among you who can play around with LAMP without any stress of installing it.

Posted by: Stephan | Tagged as: , , , No Comments
7Oct/137

Adding IPv6 connectivity to your server

With the recent deployment of IPv6 in our data centre network, newly installed servers should be configured with an IPv6 address out of the box. For existing installations that you do not want to reinstall or colocation devices not installed with our operating system deployment solution, the necessary information needs to be added to your system manually. This guide should give you enough information to get IPv6 up and running on your server.

Obtaining the necessary information

We have already assigned an IPv6 address to every one of your services where applicable. You can find this address in your customer control panel, which should look like this:

ipv6ccp

Do not use the address space shown in the image, "2a02:c200:0:10:3:0:7:1". Use your own IPv6 address space from your customer control panel instead.

At this time, the following additional information is valid for every IPv6 enabled server:

netmask / prefix length: 64
gateway address: fe80::1

For servers with a /64 network starting with "2a02:c205", please use the following IP addresses as resolving name servers:

Resolver/DNS server 1: 2a02:c205::1:53
Resolver/DNS server 1: 2a02:c205::2:53

For servers with a /64 network starting with "2a02:c207", please use the following IP addresses as resolving name servers:

Resolver/DNS server 1: 2a02:c207::1:53
Resolver/DNS server 1: 2a02:c207::2:53

Initial configuration (Linux-based operating systems)

Before adding this IPv6 address to your configuration files and thus making the changes persist after a server reboot, you might want to configure it manually. I will use the IPv6 address 2001:db8::1 in this example. Please replace it with the appropriate address assigned to the server in question. If your network card is not eth0, you will have to replace "eth0" with the appropriate value, too.

Add the address to the server's network interface in the format /:

ip addr add 2001:db8::1/64 dev eth0

You can validate that the address has been enabled by running

ip -6 addr show

which should show, among others, the following lines:

2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qlen 1000
inet6 2001:db8::1/64 scope global valid_lft forever preferred_lft forever

In order to reach everyone else in the ever growing IPv6 world, add a default route to the server's configuration:

ip route add default via fe80::1 dev eth0

Again, you can verify the setting by running

ip -6 route show

which should show the following output:

default via fe80::1 dev eth0 metric 1024 mtu 1500 advmss 1440 hoplimit 4294967295

You can now check your IPv6 connectivity by using the ping6 command:

ping6 2a02:c205:0:5001::1

Making things persist (Linux-based operating systems)

Different operating systems have different ways of setting up the network configuration. If in doubt, please search the documentation for your operating system. Sample configurations for Debian/Ubuntu and CentOS/Fedora/RedHat will be provided here. Please be very careful when applying these changes. Errors may result in your server no longer responding to any network traffic at all!

Debian / Ubuntu

Edit the file /etc/network/interfaces and add the following lines:

iface eth0 inet6 static
address 2001:db8::1
netmask 64
gateway fe80::1
accept_ra 0
autoconf 0
privext 0

CentOS / Fedora / RedHat

Make sure IPv6 networking is enabled at all by editing /etc/sysconfig/network. Add the following line to this file:

NETWORKING_IPV6=yes

Then add the IP configuration to the file /etc/sysconfig/network-scripts/ifcfg-eth0

IPV6INIT=yes
IPV6ADDR=2001:db8::1/64
IPV6_DEFAULTGW=fe80::1
IPV6_DEFAULTDEV=eth0

This should make sure the IPv6 address gets enabled again after your server reboots.

Configuration steps for Windows Server operating systems

After you have connected to your server using RDP, click on "Start" > "Control Panel" > "Network and Internet" > "Network and Sharing Center". Click on "Change Adapter Settings" on the left side of the window. Right-click the icon for the network connection, select "Properties" from the menu:

IPv6-Windows-1

Highlight the entry "Internet Protocol Version 6 (TCP/IP)" on the list, make sure that the checkbox is ticked and click on "Properties" again. Enter the information you gathered from step one as shown below:

IPv6-Windows-2

Click on "OK", to close the dialogues and save the changes.

Still cannot reach your server via IPv6?

If you have made the changes as described above and if the ping6 command did return a response but you nevertheless cannot reach your server via IPv6 from your local computer, chances are that IPv6 might not yet be enabled in your local network. Your local ISP can help in this case.

Posted by: Markus | Tagged as: , , , , , 7 Comments
27Aug/130

Process Controlling With Supervisor

If you run your own virtual or dedicated server, chances are that you want to run a specific program or a number of programs that make up the service you want to use or offer. If the program you want to run is part of the Linux distribution of your choice there usually is not much more to it than installing the package and configuring the program. However, if the program comes from an external source or you are writing it yourself, you need to make sure it is started automatically when the server is booting. Additionally, during development or early testing phases of your own program, there might be errors in the code leading to a crash of your application and you might want to make sure that it gets restarted automatically in such a case. A few years ago, the solution to the first issue was quite simple. All you needed to do was to create an init script that would then handle the starting and stopping of the server. However, recently many Linux distributions changed the way they handle the boot process. Some are still using init, others may be using upstart or even systemd now. Providing the files necessary for all of this systems can be quite a hassle and while upstart and systemd support restarting programs on unexpected termination, implementing this with init is possible but requires to change init's configuration itself.

For my own needs I have become attached to using supervisor for this task - the program and the documentation can be found on http://supervisord.org, but most Linux distributions provide pre-built packages in their repositories. Supervisor itself is a daemon that is run by the system's process management so it gets run by init or it's counterparts. To run your own program, you have to add it to supervisord's configuration and it will make sure that it gets started on boot and restarted in case it crashes.

As an example, I will be using a very small custom web application written in Python using the bottle framework. Since this article is not about web programming, I am keeping it simple:

1 from bottle import route, run
2
3 @route('/')
4 def index():
5     return 'Hello World'
6
7 run(host='0.0.0.0', port=8080)

All this does is run a webserver on port 8080 and displaying Hello World in your web browser when you navigate to it. If the above code is saved to a file app.py, you can run it using python app.py and it will just run forever (or until it crashes). Now would be a good time to configure supervisor to run this application for us. Supervisor provides a command line tool called supervisorctl to check the status of configured applications and to start or stop them if needed. Running supervisorctl status will show you... nothing, as we did not set up anything yet. We create a new file called hello.conf which will contain everything supervisor needs to know to run our application and place it in /etc/supervisor/conf.d/. The most basic configuration defines a new program to run with a given name and a command to be executed as well as a user name that the program should be run with - if you leave this, your program will run as root which is almost always a bad idea:

[program:hello]
command=/usr/bin/python /home/markus/app.py
user=markus

Note that it is usually a good idea to provide absolute paths in such configurations. After the file has been saved, you can use supervisorctl reread to cause supervisor to reread its configuration file. If everything is right, the output of the command should tell you that a program named hello is now available:

# supervisorctl reread
hello: available

We can now start the program by running

# supervisorctl start hello
hello: started

Check the status again to see if its actually running now:

# supervisorctl status
hello                 RUNNING    pid 32675, uptime 0:00:46

As you can see, it tells us that the program is running, it's PID and the time elapsed since it's start. To simulate a crash, we will forcefully terminate the program and check if supervisor restarts it as expected:

# kill -9 32675
# supervisorctl status
hello                 RUNNING    pid 32686, uptime 0:00:04

The supervisor homepage gives you a lot more information about possible values to configure supervisor itself and the programs it runs. You can even configure the location of log files and automatic rotation for them in case they grow over a given size. More details about this can be found here: http://supervisord.org/configuration.html. Finally, no more reason to run your applications in detached screen sessions... 😉