We are in the process of migrating this forum. A new space will be available soon. We are sorry for the inconvenience.

My XenServer VPS with Debian 4.0 Setup


yonatan
27-12-2009, 10:28
Quote Originally Posted by brgroup

I am also running the Windows version of XenCenter from Citrix, which allows me to control my slices. The software only comes in Windows flavor, so if you are running Linux or Mac, maybe try Wine or Crossover otherwise, you can control your XenServer install with the command line, which is beyond this guide.
well ,
Linux has virt-manager

http://virt-manager.et.redhat.com/screenshots.html


brgroup
27-12-2009, 07:01
24) We're going to create a VNC user session. First if you don't have it, get yourself a free copy of Putty and install it:
Using putty is beyond this tutorial, but it's fairly easy and you can google to get a sense of how it works.

25) SSH into your VM using your IP address from Virtual Mac setup
Code:
Host: xxx.xxx.xxx.xxx
Port 22
Login to the server using your credentials:
Code:
Login: NewAdminUser
Password: Admin Password
NOTE: you may want to create a new NON-ADMIN user if you have clients that don't have admin access but need to login to VNC..Just use the ADDUSER command in the Xencenter Root console and Don't add them to the sudoers file. then you can login as above and use the following commands to setup vnc for that user.

26) Start and stop vnc4server
Code:
vnc4server
vnc4server -kill :1
27) Configure VNC startup options to start the Xfce desktop
Code:
cd .vnc
nano xstartup
At the bottom of the file, change the last to lines to look like this:
Code:
#x-window-manager &
startxfce4 &
SAVE and CLOSE:
Code:
ctrl+X, enter and Y to exit
28) Let's create a script that starts VNC automatically at the VM boot. That way you won't have to type it in every time. Do the following as an ADMIN or ROOT user:
Code:
sudo nano /etc/init.d/vnc4server
Enter the following into the new file:
Code:
#!/bin/sh -e
### BEGIN INIT INFO
# Provides:          vnc4server
# Required-Start:    networking
# Default-Start:     S
# Default-Stop:      0 6
### END INIT INFO

PATH="$PATH:/usr/X11R6/bin/"

# The Username:Group that will run VNC
export USER="NewAdminUser"
#${RUNAS}

# The display that VNC will use
DISPLAY="1"

# Color depth (between 8 and 32)
DEPTH="16"

# The Desktop geometry to use.
#GEOMETRY="x"
#GEOMETRY="800x600"
GEOMETRY="1024x768"
#GEOMETRY="1280x1024"

# The name that the VNC Desktop will have.
NAME="YOUR VNC DESKTOP NAME"

OPTIONS=":${DISPLAY} -geometry ${GEOMETRY} -depth ${DEPTH} -name ${NAME}"

. /lib/lsb/init-functions

case "$1" in
start)
log_action_begin_msg "Starting vncserver for user '${USER}' on localhost:${DISPLAY}"
su ${USER} -c "/usr/bin/vnc4server ${OPTIONS}"
;;

stop)
log_action_begin_msg "Stoping vnc4server for user '${USER}' on localhost:${DISPLAY}"
su ${USER} -c "/usr/bin/vnc4server -kill :${DISPLAY}"
;;

restart)
$0 stop
$0 start
;;
esac

exit 0
Be sure to adjust the USERNAME, DESKTOP NAME and YOUR PREFFERED SETTINGS
Code:
SAVE and CLOSE: Ctrl+X , Y and Enter
29) Now you MUST make the script executable and add it to the startup process. type these in:
Code:
sudo chmod +x /etc/init.d/vnc4server
sudo update-rc.d vnc4server defaults
And finally RESTART vnc4server:
Code:
sudo /etc/init.d/vnc4server start
30)Get yourself a free copy of the TightVNC client if your don't have it:
Code:
http://www.tightvnc.com/download/1.3.10/tightvnc-1.3.10-setup.exe
Install TightVNC
NOTE: Be sure to uncheck the VNCServer installation or you'll be running a local version of the server.

Run Tight VNC viewer and login to your server using the VNC password you created:
-VNC Server: xxx.xxx.xxx.xxx:1
-Password

Your shiny new XFCE desktop should appear.

If that's all you need for your VPS install feel free to stop here..

Now I may get some flack for including the next section. By including the following instructions, I DO NOT endorse any illegal use of any software that the following facilitates. It is included for instructional purposes only. I take no responsibility either way on how you use it. We're all adults here and you get to choose how you work within OVH's TOS.

That said, let's have at it.


31)Go BACK to the Root console in your XenCenter software.
Download and Install Wine

Code:
wget http://www.lamaresh.net/apt/dists/etch/main/binary-i386/wine_1.1.15~winehq1-1_i386.deb
And Install Wine dependencies:
Code:
apt-get install esound-common libasound2 libaudio2 libaudiofile0 libesd0 libgphoto2-2 libgphoto2-port0 liblcms1 libxslt1.1
And finally Install Wine itself:
Code:
dpkg -i wine_1.1.15~winehq1-1_i386.deb
I will only show how to install uTorrent in this tutorial. For setup guides and usage, there are plenty available via google.

32) Download uTorrent and save in the user home folder:
Code:
cd /home/NewAdminUser
wget http://download.utorrent.com/1.8.5/utorrent.exe
33) SWITCH to your open TightVNC desktop and run the following in Terminal:
Code:
wine utorrent.exe /noinstall /bringtofront
34) Open the File manager and create some Download folders for uTorrent to point to.

35) Create an auto-start link to uTorrent. In your TightVNC desktop,
Choose from the taskbar at the bottom:

Code:
XFCE4 | SETTINGS | AUTOSTARTED APPLICATIONS
-Uncheck Xfce4 Tips
-Click ADD

Enter the following in the dialogue box:
-Name: UTorrent
-Desc: Wine with uTorrent
-Command:
Code:
wine utorrent.exe /noinstall /bringtofront
You can now leave uTorrent running, and close the TightVNC window. Your software will continue to run in the background..

brgroup
27-12-2009, 06:59
Requirements:
-OVH Dedicated server w/ OVH manager access
-Local Windows machine for XenCenter software
-Extra Ip's accessible in OVH manager


After much trial and error I finally have a good working system for creating workable Debian 4.0 Etch slices using XenServer with my 3 failover IP's. Currently I am running an EG-Best Of which seems to suit these VPS perfectly.

I am also running the Windows version of XenCenter from Citrix, which allows me to control my slices. The software only comes in Windows flavor, so if you are running Linux or Mac, maybe try Wine or Crossover otherwise, you can control your XenServer install with the command line, which is beyond this guide.

Obviously, one would have to purchase more IP's in order to create a production server and Debian slices for sale to see any sort of profit.

Again, I've only created using Debian 4 and had absolutely NO success with any Windows server release.

AND I am a complete newbie at working with VPS's so I cannot provide tech support! I am learning as I go and am interested in learning more, so please any smarter and more savvy people jump in to the fray if someone is having difficulty!

Please feel free to correct or comment or add to any of this..


1) In OVH manager reinstall OS to XenServer. You can format and partition your disks to suit your needs. Since I could, I converted my partitions to RAID 0 like so:
Partition 1 ext3 / "20,000MB"
Partition 2 ext3 swap "1024MB"
Partition 3 ext3 "RAID 0" /home "all the rest"
2) After Zen server installation. Download and install the XenCenter Windows software from the Citrix website:
Code:
http://downloadns.citrix.com.edgesuite.net/akdlm/4212/FREE_XenServer-5.5.0-XenCenter.msi
3) After your XenServer installation on your OVH server, fire up the local XenCenter client and connect to your server using your IP address, root and password that your received in your server installed notification email from OVH.

4) In the OVH manager create Virtual Mac addresses for your failover IP's:
-Assign an IP address
-Create a name
-Make sure to choose OVH type from the drop down.

NOTE: be sure to create your Virtual Macs BEFORE you create your VM's in XenCenter or the server will crash and reboot because the switch will think 2 IP's are coming from the same mac address!

5) Now in XenCenter create a new VM from the taskbar at the top and make make the following decisions to suit your needs:
-Choose "Debian 4 Etch" OS
-Name your VM
-Choose Virtual disk size and Location. BE SURE TO EDIT THE EXISTING DISK AND ADD SPACE TO IT!
-Choose RAM and CPU sizes
-Network - IMPORTANT!! Click on the 'MAC Address box and replace "auto-generated" with the Virtual Mac you created in the OVH manager Don't worry about the IP. We'll enter it later.
-Choose Auto-Start VM

Let the setup allocate the space and start your VM

6) Highlight your new VM and choose the "Console" tab at the right. A commandline console will startup.

7) Create and verify:
ROOT Password
VNC password

8) the OS will continue to setup. NOTE: DHCP will try to create an IP address. Just disregard any output.

9) Login using ROOT and the password you just created.

10) Create a new admin user:
Code:
adduser NewAdminUser
11) Add your new user to the sodoers file to give sudo privs. TYPE:
Code:
visudo
Look for the entry ROOT=ALL(ALL) ALL
and ADD this entry on the next line below it:
Code:
NewAdminUser ALL=(ALL) ALL
12)Add your virtual device to networking:
Code:
nano /etc/network/interfaces
replace contents with following:
Code:
# Used by ifup(8) and ifdown(8). See the interfaces(5) manpage or
# /usr/share/doc/ifupdown/examples for more information.

auto lo
iface lo inet loopback


##Public Network
auto eth0
iface eth0 inet static
##Your IP failover IP Address from Virtual mac setup
address xxx.xxx.xxx.xxx
netmask 255.255.255.0
##The SAME failover IP address from virtual mac setup
gateway xxx.xxx.xxx.xxx
SAVE and CLOSE:
Code:
ctrl+X, enter and Y to exit
13) Change Hosts file and add hostname entry and IP:
Code:
nano /etc/hosts
You can create any host you would like; eg joesserver.ovh.net
Code:
127.0.0.1 localhost localhost.localdomain
##Use your same IP from the virtual Mac setup
xxx.xxx.xxx.xxx HOST.DOMAIN.COM HOST
SAVE and CLOSE:
Code:
ctrl+X, enter and Y to exit
14) add nameservers for DNS resolution. I use Google:
Code:
nano /etc/resolv.conf
Add the following to the file:
Code:
search 127.0.0.1
nameserver 8.8.8.8
nameserver 8.8.4.4
SAVE and CLOSE:
Code:
ctrl+X, enter and Y to exit
15)Restart networking in console
Code:
/etc/init.d/networking restart
16) Now we'll update our OS and install some software we (might) need..

DO THE FOLLOWING IN THE XenCenter CONSOLE as ROOT:

17) Import APT-KEYS for repositories:
Code:
gpg --keyserver wwwkeys.eu.pgp.net --recv 9AA38DCD55BE302B
gpg --export --armor 9AA38DCD55BE302B | apt-key add -
Should get an 'OK'

18) And update the gpg key for Citrix Xen-Server
Code:
wget -q http://updates.vmd.citrix.com/XenServer/5.5.0/GPG-KEY -O- | apt-key add -
Should get an 'OK'

19) Update and Upgrade Debian RUN:
Code:
apt-get update
apt-get upgrade
FYI - You will have to choose a Time Zone and restart SSH

20)Now we are going to install a graphical interfaceaccessible through VNC. I use XORG, you can use any other you like, including: gnome, kde, lxde or fluxbox.

21) Download and install window manager XORG and proftpd
Code:
apt-get install xorg proftpd
NOTE: For proftpd choose standalone

22) We will make some changes to ProFtpd..Disable IPV6 and Lock user in their directories:
Code:
nano /etc/proftpd/proftpd.conf
Make the following changes and additions:
Code:
UseIPv6        off
DefaultRoot    ~
SAVE and CLOSE:
Code:
ctrl+X, enter and Y to exit
23) RESTART Proftpd:
Code:
/etc/init.d/proftpd restart