Category Archives: VPS

Install XenServer tools in your VM

Install XenServer tools

Next step is to install those tools. Also I’ll give you some tips.

For any VM, go in the console view on your VM, and insert the appropriate ISO:

  • xs-tools.iso for XenServer 6 and older
  • guest-tools.iso for XenServer 7 and high

Then, each system is a bit different.

For Linux VMs

Debian, Ubuntu (deb based)

For a Debian VM, it’s pretty simple, as root:

  • mount /dev/cdrom /mnt
  • bash /mnt/Linux/install.sh
  • umount /dev/cdrom

In a real example:

root@myVM:~# mount /dev/cdrom /mnt       
mount: block device /dev/xvdd is write-protected, mounting read-only
root@myVM:~# bash /mnt/Linux/install.sh 
Detected `Debian GNU/Linux 7.9 (wheezy)' (debian version 7).

The following changes will be made to this Virtual Machine:
  * update arp_notify sysctl.
  * packages to be installed/upgraded:
    - xe-guest-utilities_7.0.0-24_all.deb

Continue? [y/n] Y

(Reading database ... 37679 files and directories currently installed.)
Preparing to replace xe-guest-utilities 6.2.0-1133 (using .../xe-guest-utilities_7.0.0-24_all.deb) ...
Stopping xe daemon:  OK
Unpacking replacement xe-guest-utilities ...
Setting up xe-guest-utilities (7.0.0-24) ...
Installing new version of config file /etc/init.d/xe-linux-distribution ...
$Detecting Linux distribution version: OK
$Starting xe daemon:  OK

You should now reboot this Virtual Machine.
root@myVM:~# 

That’s all! You can eject the ISO now.

As soon the .deb is installed, tools will report their info: no need to reboot!

CentOS, RHEL (rpm based)

Same principle, almost same procedure than on a Deb based distro:

# mount /dev/cdrom /mnt/
mount: block device /dev/xvdd is write-protected, mounting read-only
[root@localhost ~]# bash /mnt/Linux/install.sh 
Detected `CentOS release 6.6 (Final)' (centos version 6).

The following changes will be made to this Virtual Machine:
  * update arp_notify sysctl.
  * packages to be installed/upgraded:
    - xe-guest-utilities-7.0.0-24.x86_64.rpm
    - xe-guest-utilities-xenstore-7.0.0-24.x86_64.rpm

Continue? [y/n] y


Preparing...                ########################################### [100%]
   1:xe-guest-utilities-xens########################################### [ 50%]
   2:xe-guest-utilities     ########################################### [100%]

You should now reboot this Virtual Machine.
[root@localhost ~]# 

Nope, rebooting is not mandatory.

Using Screen

Screen is like a window manager for your console. It will allow you to keep multiple terminal sessions running and easily switch between them. It also protects you from disconnection, because the screen session doesn’t end when you get disconnected.

You’ll need to make sure that screen is installed on the server you are connecting to. If that server is Ubuntu or Debian, just use this command:

sudo apt-get install screen

Now you can start a new screen session by just typing screen at the command line. You’ll be shown some information about screen. Hit enter, and you’ll be at a normal prompt.

To disconnect (but leave the session running)

Hit Ctrl + A and then Ctrl + D in immediate succession. You will see the message [detached]

To reconnect to an already running session

screen -r

To reconnect to an existing session, or create a new one if none exists

screen -D -r

To create a new window inside of a running screen session

Hit Ctrl + A and then C in immediate succession. You will see a new prompt.

To switch from one screen window to another

Hit Ctrl + A and then Ctrl + A in immediate succession.

To list open screen windows

Hit Ctrl + A and then W in immediate succession

There’s lots of other commands, but those are the ones I use the most.

 

Source: https://www.howtogeek.com/howto/ubuntu/keep-your-ssh-session-running-when-you-disconnect/

Mount: special device /dev/xvdd does not exist When Installing XenServer Tools on Linux

According to the Citrix documentation, the command to mount the XenServer tools ISO image on a Linux OS is this:

mount /dev/xvdd /mnt

But this does not work on CentOS or Ubuntu virtual machines, because these use a different naming convention for CD-ROM devices.

Mount XenServer Tools in CentOS

sudo mount /dev/cdrom1 /mnt

Mount XenServer Tools in CentOS 7

sudo mount /dev/sr0 /mnt

Mount XenServer Tools in Ubuntu

sudo mount /dev/cdrom /mnt

Blueonyx OpenVZ OS Template

We are proud to announce our completion of a Blueonyx OpenVZ Template.

BlueOnyx is a Linux distribution (based on CentOS v5.5) which aims at delivering a turnkey server appliance for webhosting. It comes with a web based GUI interface which allows you (and your email, FTP and webhosting clients!) to manage most aspects of the server, its sites and accounts through a browser based interface. It is open source software, released under a Sun modified BSD license.
Continue reading Blueonyx OpenVZ OS Template

Basic Server Setup

No matter how new your server or vps is, it is outdated and running old software.  While I am not the best, nor do I know everything this is a base of what I do when I get a new box online.

Again assuming you can SSH into the box.

yum -y install nano
yum -y install yum-priorities
wget http://apt.sw.be/redhat/el5/en/i386/RPMS.dag/rpmforge-release-0.3.6-1.el5.rf.i386.rpm
rpm –import http://dag.wieers.com/rpm/packages/RPM-GPG-KEY.dag.txt
rpm -K rpmforge-release-0.3.6-1.el5.rf.*.rpm
rpm -i rpmforge-release-0.3.6-1.el5.rf.*.rpm
wget http://dag.linux.iastate.edu/dag/RPM-GPG-KEY.dag.txt
rpm –import RPM-GPG-KEY.dag.txt

nano /etc/yum.repos.d/dag.repo

[dag]
name=Dag RPM Repository for Red Hat Enterprise Linux
baseurl=http://dag.linux.iastate.edu/dag/redhat/el5/en/$basearch/dag
gpgcheck=1
enabled=1

Save and Exit

yum -y install perl-libwww-perl
yum -y update

chkconfig cups off
chkconfig pcmcia off
chkconfig kudzu off
chkconfig isdn off
chkconfig xfs off
chkconfig atd off
chkconfig nfslock off
chkconfig canna off
chkconfig FreeWnn off
chkconfig cups-config-daemon off
chkconfig iiim off
chkconfig mDNSResponder off
chkconfig nifd off
chkconfig rpcidmapd off
chkconfig bluetooth off
chkconfig anacron off
chkconfig gpm off
chkconfig saslauthd off
chkconfig avahi-daemon off
chkconfig avahi-dnsconfd off
chkconfig hidd off
chkconfig pcscd off
chkconfig sbadm off
chkconfig ossec off
chkconfig acpid off
chkconfig dhcpd off
chkconfig firstboot off

mkdir /root/source
cd /root/source
wget http://www.configserver.com/free/csf.tgz
tar -xzf csf.tgz
cd csf
sh install.sh

nano /etc/csf/csf.conf

Change TESTING=”1″ to TESTING=”0″
AUTO_UPDATES=”0″ to AUTO_UPDATES=”1″

TCP_IN = “20,21,22,25,26,37,43,53,80,106,110,113,143,443,465,587,873,990,993,995,1129,2077,2078,2082,2083,2086,2087,2095,2096,3306,5224,5432,7777,7778,8443,8880,8888,8889,9080,10000,30000:35000”
TCP_OUT = “20,21,22,25,26,37,43,53,80,106,110,113,143,443,465,587,873,990,993,995,1129,2077,2078,2082,2083,2086,2087,2095,2096,3306,5224,5432,7777,7778,8443,8880,8888,8889,9080,10000”
UDP_IN = “20,21,53,953”
UDP_OUT = “20,21,53,113,123,953,33434:33523”

service csf restart
service lfd restart

reboot

. Add Passive Port range 30000-350000 to your Pureftp or Proftp configuration file
(i) Pureftpd
open /etc/pure-ftpd.conf, and this line
PassivePortRange    30000 35000
(ii) ProFTP
Open /etc/proftpd.conf, and add this line
PassivePorts    30000 35000

Now there are many other things you can do, root kit hunters and log rotators and more. However depending on your needs this alone will get you off to a good start.

Switching from Apache to Lighttpd

One of my side projects is running a free image hosting site.  FreeImageHostingOn.US with this site I have been pushing out millions of hits a day and as you can imagine it puts a load on many shared hosting providers.  So the other day I grabbed a VPS from Ruby Ring Technologies and I installed the CentOS/LXAdmin image.  Out of the box this VPS screamed.  However I know I could get more performance out of it.  The following six lines of code did more then double the thruput and halved the ram usage.

Add the following lines to the lighttpd.conf file.

server.max-keep-alive-requests = 4
server.max-keep-alive-idle = 4
server.event-handler = “linux-sysepoll”
server.network-backend = “linux-sendfile”
server.max-fds = 8192
server.stat-cache-engine = “simple”

As you can see from the following image, things are moving along nicely.

Bandwidth Traffic

The current load on the server is 0.0 and the ram used it 66MB’s for live stats check out this link.  System Usage.