Difference between revisions of "User:Deepb"

From LinuxMCE
Jump to: navigation, search
 
(14 intermediate revisions by the same user not shown)
Line 30: Line 30:
 
NOTE: if you have multiple newtork cards make sure you plug the cable into the right one, if you do not have network connection try the other one.
 
NOTE: if you have multiple newtork cards make sure you plug the cable into the right one, if you do not have network connection try the other one.
 
===Networking===
 
===Networking===
Networking should work out of the box, if it does you can ignore this chapter.  
+
Networking should work out of the box, if it does you can ignore this chapter and continue with [[Update]].  
 
Else: check if there is internet connectivity by pinging something.
 
Else: check if there is internet connectivity by pinging something.
 
  ping google.com
 
  ping google.com
Line 51: Line 51:
 
       bridge_stp off
 
       bridge_stp off
 
       bridge_fd 0
 
       bridge_fd 0
 +
if you did change some network setting run
 +
/etc/init.d/networking restart
 +
===Update===
 +
run
 +
aptitude update && aptitude full-upgrade
 +
If you get the message
 +
E: Some index files failed to download. They have been ignored, or old ones used instead.
 +
you can ignore it, or if rather not you can edit
 +
nano /etc/apt/sources.list.d/pve-enterprise.list
 +
and comment out the enterpries repository by placing a "#" in front of it.
 +
#deb https://enterprise.proxmox.com/debian wheezy pve-enterprise
 +
 +
==Software Raid==
 +
If you do not want to use softwar raid you can continue with the next chapter.
 +
<span style="background:#ff0000">WARNING: Software raid is not supported by proxmox!</span>
 +
But of course it works nevertheless, but as usual do it on your own risk.
 +
This part of the guide is based in a German guide found here[http://dominicpratt.de/proxmox-ve-3-0-software-raid/]
 +
First install the required package:
 +
apt-get update; apt-get install mdadm screen
 +
If there are any prompts on installing mdadm just ignore or press yes.
 +
 +
If you have not done so yet shutdown and plugin the second (identical) drive.
 +
In this guide the harddrive that proxmox was installed on is /dev/sda, while the second to use in the raid is /dev/sdb. If you have different drive letter, please change them accordingly.
 +
Prepare and create raid:
 +
sfdisk -d /dev/sda | sfdisk -f /dev/sdb
 +
sfdisk -c /dev/sdb 1 fd
 +
sfdisk -c /dev/sdb 2 fd
 +
mdadm --create -l1 -n2 /dev/md0 missing /dev/sdb1
 +
mdadm --create -l1 -n2 /dev/md1 missing /dev/sdb2
 +
copy /boot to the new raid md. (Note: md with raid means "multiple device" and has nothing to do with media director)
 +
mkfs.ext3 /dev/md0
 +
mkdir /mnt/md0
 +
mount /dev/md0 /mnt/md0
 +
cp -ax /boot/* /mnt/md0
 +
Then edit the fstab
 +
nano /etc/fstab
 +
and find the line for boot that says
 +
UUID=xxxxxxxxx /boot ext3 defaults 0 1
 +
and change it to
 +
/dev/md0 /boot ext3 defaults 0 1
 +
then reboot and check with
 +
mount | grep boot
 +
that /dev/md0 is mounted on /boot.
 +
if that worked we tell grub that we want to boot from the raid:
 +
echo ‘GRUB_DISABLE_LINUX_UUID=true’ >> /etc/default/grub
 +
echo ‘GRUB_PRELOAD_MODULES=”raid dmraid”‘ >> /etc/default/grub
 +
echo raid1 >> /etc/modules
 +
echo raid1 >> /etc/initramfs-tools/modules
 +
grub-install /dev/sda --recheck
 +
grub-install /dev/sda
 +
grub-install /dev/sdb --recheck
 +
grub-install /dev/sdb
 +
update-grub
 +
update-initramfs -u
 +
Then we add sda1 to the raid (note: this might take some time, so make a coffee... or do it over the night. It might take >3 hours on 1TB). You should probably use screen.
 +
screen
 +
sfdisk -c /dev/sda 1 fd
 +
mdadm –add /dev/md0 /dev/sda1
 +
and move the root lvm onto the raid too
 +
pvcreate /dev/md1
 +
vgextend pve /dev/md1
 +
pvmove /dev/sda2 /dev/md1
 +
vgreduce pve /dev/sda2
 +
pvremove /dev/sda2
 +
sfdisk –change-id /dev/sda 2 fd
 +
mdadm –add /dev/md1 /dev/sda2
 +
with
 +
cat /proc/mdstat
 +
you can see how far the building of the new raid is, and only if it is finnished reboot.
 +
==Checking Network again==
 +
If you do not see the two network adapters (vmbr0 and vmbr1) in
 +
ifconfig
 +
you need to change edit interfaces again.
 +
nano /etc/network/interfaces
 +
mine looks like that:
 +
auto lo
 +
iface lo inet loopback
 +
auto vmbr0
 +
iface vmbr0 inet static
 +
        address 192.168.0.13
 +
        netmask 255.255.255.0
 +
        gateway 192.168.0.1
 +
        bridge_ports eth0
 +
        bridge_stp off
 +
        bridge_fd 0
 +
auto vmbr1
 +
iface vmbr1 inet static
 +
        address  10.0.0.1
 +
        netmask  255.255.255.0
 +
        bridge_ports eth1
 +
        bridge_stp off
 +
        bridge_fd 0
 +
 +
==Installing LinuxMCE==
 +
open a browser (on any pc in the network, not on the server) and navigate to https://server-ipadress:8006. Substitute server-ipadress for the ipadress of the proxmox-server. this is usually something like https://192.168.0.5:8006
 +
 +
In the left column open datacenter, then your server (the servername), then local (storage) and click in the upper middle of the page on upload. Select the linuxmce iso and upload it. There are also other possibilities, including copying from a NAS, but for further information see the proxmox wiki [http://pve.proxmox.com/wiki/Main_Page].
 +
 +
When the upload is done click on the very upper right "create VM" to create a VM.
 +
You only have one node, the VM ID you can put wathever you want, the same for the Name. Ignore the REsource Pool.
 +
Click on Next
 +
 +
Choose Linux 3.x/2.6 Kernal (l26) and click on Next.
 +
 +
Then choose the iso image you just uploaded and click on Next
 +
 +
Note: Everything from here on you can change later.
 +
 +
Change Bus/Device from IDE to virtio (better performance)
 +
Put in the Disk Size you want, and leave everything else. Click on Next.
 +
 +
Choose the CPU Cores, and click Next.
 +
 +
Choose Memory size an click Next.
 +
 +
Change Network model to virtio (better performance) and klick next.
 +
 +
Click Finnish to create VM.
 +
Congratulations, now you have succesfully created the first VM.
 +
 +
But not all work is done, the VM still has only one network interface.
 +
 +
Now select the new VM on the left, then click on Hardware and select add->network device
 +
Select the Second Bridge, and again Model: Virtio and click add.
 +
 +
Congratulations, now you have everything you need. Click on Start to start the VM, and on Console to get the screen of the VM.
 +
Please note that the Console is quite picky about the java version, if it does not work try another one.

Latest revision as of 07:29, 14 September 2013

Installation of LinuxMCE in a KVM Virtual Machine

On this page I will describe the installation process of LinuxMCE in a KVM virtual machine. As a host system I use proxmox, a very user friendly and easy to use bare metal hypervisor.

Download Required Software

Download Proxmox the latest version of proxmox: [1]

At the moment of this writing the current version is Proxmox VE 3.1

Download LinuxMCE [2]

At the moment of this writing the current version is LinuxMCE 1004 final

Adittionally if you are on Windows and want to use a usb-stick: (you do not need any addidional program on Linux)

Suse Studio Image Writer [3] to write the image to a usb-stick. UnetBootin and Rufus do not work.

Copying Image to USB-Stick

If you want to use a CD simply burn the iso to a cd.

On Linux

Please make sure that /dev/XYZ is the right device, as this delets all content. Please also note that this is the device WITHOUT the number for the partition. SO for example /dev/sdc AND NOT /dev/sdc1 pve-cd.iso is the current proxmox iso that you downloaded.

dd if=pve-cd.iso of=/dev/XYZ bs=1M

On Windows

First delete the partition of the usb-stick, else Suse Studio Image Writer might fail with a access failed error. Then rename the Proxmox iso that you downloaded from .iso to .raw. Run Suse Studio Image Writer, selct the drive and the image.

Base Installation of Proxmox

The graphical installation guide is straightforward and easy to understand. Please note though that the installer DELETS ALL PARTITIONS ON THE SELECTED DRIVE! So all data on that drive is lost! You might want to unhook all harddrives that have unsaved data on it just to make sure you do not pick the wrong one by accident.

Reboot and Settings

After the base installation reboot the system, and check if you put in the right ip data in the installation process. NOTE: if you have multiple newtork cards make sure you plug the cable into the right one, if you do not have network connection try the other one.

Networking

Networking should work out of the box, if it does you can ignore this chapter and continue with Update. Else: check if there is internet connectivity by pinging something.

ping google.com

If you want to change the network settings

nano /etc/network/interfaces

if you want to use dhcp for the public interface this should look like:

auto lo
iface lo inet loopback
auto vmbr0
iface vmbr0 inet dhcp

If you want to use static it should look something like that:

auto lo
iface lo inet loopback
auto vmbr0
iface vmbr0 inet static
      address 192.168.0.13
      netmask 255.255.255.0
      gateway 192.168.0.1
      bridge_ports eth0
      bridge_stp off
      bridge_fd 0

if you did change some network setting run

/etc/init.d/networking restart

Update

run

aptitude update && aptitude full-upgrade

If you get the message

E: Some index files failed to download. They have been ignored, or old ones used instead.

you can ignore it, or if rather not you can edit

nano /etc/apt/sources.list.d/pve-enterprise.list

and comment out the enterpries repository by placing a "#" in front of it.

#deb https://enterprise.proxmox.com/debian wheezy pve-enterprise

Software Raid

If you do not want to use softwar raid you can continue with the next chapter. WARNING: Software raid is not supported by proxmox! But of course it works nevertheless, but as usual do it on your own risk. This part of the guide is based in a German guide found here[4] First install the required package:

apt-get update; apt-get install mdadm screen

If there are any prompts on installing mdadm just ignore or press yes.

If you have not done so yet shutdown and plugin the second (identical) drive. In this guide the harddrive that proxmox was installed on is /dev/sda, while the second to use in the raid is /dev/sdb. If you have different drive letter, please change them accordingly. Prepare and create raid:

sfdisk -d /dev/sda | sfdisk -f /dev/sdb
sfdisk -c /dev/sdb 1 fd
sfdisk -c /dev/sdb 2 fd
mdadm --create -l1 -n2 /dev/md0 missing /dev/sdb1
mdadm --create -l1 -n2 /dev/md1 missing /dev/sdb2

copy /boot to the new raid md. (Note: md with raid means "multiple device" and has nothing to do with media director)

mkfs.ext3 /dev/md0
mkdir /mnt/md0
mount /dev/md0 /mnt/md0
cp -ax /boot/* /mnt/md0

Then edit the fstab

nano /etc/fstab

and find the line for boot that says

UUID=xxxxxxxxx /boot ext3 defaults 0 1

and change it to

/dev/md0 /boot ext3 defaults 0 1

then reboot and check with

mount | grep boot

that /dev/md0 is mounted on /boot. if that worked we tell grub that we want to boot from the raid:

echo ‘GRUB_DISABLE_LINUX_UUID=true’ >> /etc/default/grub 
echo ‘GRUB_PRELOAD_MODULES=”raid dmraid”‘ >> /etc/default/grub 
echo raid1 >> /etc/modules 
echo raid1 >> /etc/initramfs-tools/modules 
grub-install /dev/sda --recheck
grub-install /dev/sda
grub-install /dev/sdb --recheck
grub-install /dev/sdb
update-grub
update-initramfs -u

Then we add sda1 to the raid (note: this might take some time, so make a coffee... or do it over the night. It might take >3 hours on 1TB). You should probably use screen.

screen
sfdisk -c /dev/sda 1 fd
mdadm –add /dev/md0 /dev/sda1

and move the root lvm onto the raid too

pvcreate /dev/md1
vgextend pve /dev/md1
pvmove /dev/sda2 /dev/md1
vgreduce pve /dev/sda2
pvremove /dev/sda2
sfdisk –change-id /dev/sda 2 fd
mdadm –add /dev/md1 /dev/sda2

with

cat /proc/mdstat 

you can see how far the building of the new raid is, and only if it is finnished reboot.

Checking Network again

If you do not see the two network adapters (vmbr0 and vmbr1) in

ifconfig

you need to change edit interfaces again.

nano /etc/network/interfaces

mine looks like that:

auto lo
iface lo inet loopback
auto vmbr0
iface vmbr0 inet static
       address 192.168.0.13
       netmask 255.255.255.0
       gateway 192.168.0.1
       bridge_ports eth0
       bridge_stp off
       bridge_fd 0
auto vmbr1
iface vmbr1 inet static
       address  10.0.0.1
       netmask  255.255.255.0
       bridge_ports eth1
       bridge_stp off
       bridge_fd 0

Installing LinuxMCE

open a browser (on any pc in the network, not on the server) and navigate to https://server-ipadress:8006. Substitute server-ipadress for the ipadress of the proxmox-server. this is usually something like https://192.168.0.5:8006

In the left column open datacenter, then your server (the servername), then local (storage) and click in the upper middle of the page on upload. Select the linuxmce iso and upload it. There are also other possibilities, including copying from a NAS, but for further information see the proxmox wiki [5].

When the upload is done click on the very upper right "create VM" to create a VM. You only have one node, the VM ID you can put wathever you want, the same for the Name. Ignore the REsource Pool. Click on Next

Choose Linux 3.x/2.6 Kernal (l26) and click on Next.

Then choose the iso image you just uploaded and click on Next

Note: Everything from here on you can change later.

Change Bus/Device from IDE to virtio (better performance) Put in the Disk Size you want, and leave everything else. Click on Next.

Choose the CPU Cores, and click Next.

Choose Memory size an click Next.

Change Network model to virtio (better performance) and klick next.

Click Finnish to create VM. Congratulations, now you have succesfully created the first VM.

But not all work is done, the VM still has only one network interface.

Now select the new VM on the left, then click on Hardware and select add->network device Select the Second Bridge, and again Model: Virtio and click add.

Congratulations, now you have everything you need. Click on Start to start the VM, and on Console to get the screen of the VM. Please note that the Console is quite picky about the java version, if it does not work try another one.