[UPDATE 16.9.2014]KS-1 uses different ethernet card or KS-3 or KS-4. See here steps on how to get Windows on KS-1 http://forum.kimsufi.com/showthread....l=1#post175043 [/UPDATE]
[Partial rewrite 10.6.2014] --> follow here for Linux installation
I think this introduction may clarify a little bit the idea:
[UPDATE]Install for KS-1 and KS-2: http://forum.kimsufi.com/showthread....l=1#post181131 [/UPDATE]
Qemu-kvm is a great thing, because it lets you access very easily (at least easier than VirtualBox or VMWare Player) /dev/sda and /dev/sdb. So you can run the installation of an OS in Qemu and instead of installing the OS on a virtual HDD (which is just a file of format vdi, vmdk, qcow2 or so) you are installing your OS on the real thing, namely /dev/sda or /dev/md1 (if you setup Raid during OS installation). Qemu outputs VGA output through vnc, so you can see the content of your screen and can make the proper selections, without sitting in front of the server. Now a Qemu-kvm environment is not the same thing as your server, e.g. MAC of the ethernet card is different. So you will need to make some manual changes, e.g. set DHCP, set HDD controller, etc. or install missing drivers so that, when you restart your server, those changes between a Qemu-kvm environment and your real server don't affect the boot process and connectivity to the internet, etc.
Qemu-kvm is also great for debugging (some) boot errors, since you see the screen output right from the beginning.
Understandably, you could just install your OS, e.g. Windows on your home computer or in a VM, set generic settings for ethernet, HDD controller, etc. and install missing drivers and make an image of your OS installation and copy that image onto your server. This works AND is faster (sometimes)! I have good experience with Easeus ToDoBackup 3.5 (last freeware) for Windows XP to 7 but simple clone programs like clonezilla or Ghost or even plain "dd" should get the job done. When installing at home, one would choose a small HDD partition (20-25 GB for Win7/8 should be fine) and expand it later with a partition manager or the Windows disk manager. Keeps the data transfer small.
Qemu and Windows 7/8 don't work on KS-1 and KS-2 due to a (still??) unfixed software bug. So on such a machine, I would go and clone a home installation of Windows back.
It's actually pretty easy, once you know where the caveats lie.
[NOTE] I recommend "Alternative installation at home" for Windows 2008 R2 Server installation. Qemu failed with HDD driver problems.[/NOTE]
Turn off monitoring in the Kimsufi Manager.
Partially optional: Get hadwareinfo (lshw), ip and mac info (ifconfig), routing info (route), pci info (lspci), usb info (lsusb), etc. On Kimsufi i3, i5 server you have the problem, that they use intel 82578V network card and driver don't exist for Windows Server edition. So it is partially optional, since you have to know your hardware and that your Windows has the proper drivers installed.
Booting the rescue systems gives you a complete linux system that is running on your server without using your hard disk. This means you can do all manipulations to the harddisk without the kernel interfering. Some directories lie on a network drive and are read-only. So you cannot install anything, without moving that data to tmpfs first. So let's do that first.
Please bear in mind, that Linux Rescue system uses 200 MB RAM.
The following copying of the network drives into tmpfs uses 1000 MB RAM.
Qemu uses 200 MB RAM.
#to see if Raid devices are present and stop them
mdadm --stop /dev/md0
mdadm --stop /dev/md1
#Second step is to get rid of the network drives, because they are read-only
mount -t tmpfs -o size=6000m tmpfs /mnt # use 6GB of memory as temp - adjust as needed
rsync -a /var/cache/ /mnt/var/cache/
rsync -a /var/lib/ /mnt/var/lib/
rsync -a /var/run/ /mnt/var/run/
rsync -a /usr/ /mnt/usr/
rsync -a /lib/ /mnt/lib/
mount -B /mnt/var/cache /var/cache
mount -B /mnt/var/lib /var/lib
mount -B /mnt/var/run /var/run
mount -B /mnt/usr /usr
#Update your system
apt-get -y update
apt-get -y --force-yes upgrade
#Install qemu + kvm
apt-get -y install qemu kvm
#download windows iso into /mnt
#wget http://domain.tld/yourwindows.iso #adjust as necessary
#CAREFULL Wipe hard disks, so that you can start your OS installation, remove "#" to execute
#dd if=/dev/zero of=/dev/sda bs=1M count=1
#dd if=/dev/zero of=/dev/sdb bs=1M count=1
#Now start qemu. "qemu" is 32-bit, "qemu-system-x86_64" is 64 bit. Qemu packages are 32-bit compiled, so we can only use 2047MB. As mentioned, Qemu is having a bug and doesn't run on Windows 7, 2k8, etc without kvm. Here the commands:
qemu-system-x86_64 -net nic -net user,hostfwd=tcp::3389-:3389 -m 2047M -alt-grab -localtime -enable-kvm -cpu core2duo,+nx -smp 2 -usbdevice tablet -k en-us -cdrom /mnt/yourwindows.iso -hda /dev/sda -hdb /dev/sdb -drive file=/mnt/cdrom2.iso,index=4,media=cdrom -vnc :0
-net # network card, e.g. -net nic,model=virtio -net user
-hostfwd=tcp::3389-:3389# forwards 3389 from host to 3389 from guest
-cpu (CPU Type) # see options with "qemu -cpu ?"
-enable-kvm # if kvm installed, use kvm
-smp 2# number of processors
-vnc :0 # means use vncdisplay 0 -> ":0" = 5900 port, ":1" = 5901 port, etc)
-m 1.8G# amount of memory, 2048M and more can cause problems with 32-bit complied qemu
-usbdevice # useful with VNC
-k # keyboard format needs to be used, if you use keyboard other than en-us
-cdrom # image file
-hda # first hdd -> using physical HDD
-hdb # second hdd -> using physical HDD
-drive # for second CD-ROM or file, e.g. "-drive file=/mnt/cdrom2.iso,index=2,media=cdrom" or "-drive file=WIN2K.qcow2,if=ide"
-boot d# if you need to boot from another drive e.g. /cdrom
-boot once=d # boot once from different drive.
-nographics # use kvm headless
-daemonize # run as daemon
#With this commands you can see the screen of your qemu from your home running linux
vncviewer -via root@yourip localhost:0 #secure
vnc yourip:0 #insecure
-via (login to your server through ssh, using user root and standard ssh port)
-localhost:0 (ssh makes remote server be localhost for you, :0 means connecting to port 5900 on remote server, :1 would mean connecting through port 5901, etc)
#Windows users can use tiger-vnc and putty for secure access or just tiger-vnc for unsecure access.
For secure access to your server, create a ssh tunnel with putty and use tiger-vnc to access "localhost:0". Unsecure you can access your server with tiger-vnc at "serverIP:0".
# commands to create ssh tunnel with putty, still missing.
Now you can finish your Windows installation as if you were sitting in front of your computer. If you like to setup Raid 1, just finish the installation on the first HDD. Later you can activate Raid 1 from within Windows.
Alternative installation at home
Especially if you need to install many servers, it is faster to make an image of your Windows installation and copy that image over the internet. I used this for an installation of Windows 2008 on a Core i5. Setup a VirtualBox server with
System-Motherboard: 4 GB RAM, Chipset ICH9, USB Tablet, enable I/O APIC, Hardware Clock in UTC
System-Processor: 2 CPU, PAE off
Storage: Sata, use host I/O, 25 GB HDD, CD-Rom Windows 2008 original iso (no sp1)
USB: disable USB 2.0
Finish the installation of Windows. Install VirtualBox Guest extensions.
Customize Windows to start on your server
1. Insert your Windows key
2. Make sure your Windows installation has driver for your hardware.
a) General command to add drivers to Windows Driverstore
- You need to have all drivers in one directory. E.g. when you run the self-extracting file for Intel 82578V driver, the program will extract all files in a subdirectory of your temp directory. Open a command prompt ("cmd") and change to AppData directory (cd AppData) and run "explorer ." . You can then use the explorer to open Local, Temp, 2, RarSFX0, PRO1000, WinX64, NDIS62.
Copy the directory NDIS62 to c:\NDIS62.
The command to add a driver to the driver store is "pnputil.exe -a <PathToDriver>/<Driver>.inf" or "pnputil.exe -a <PathToDriver>/*.inf", e.g.
but don't do that yet. See http://technet.microsoft.com/en-us/l.../cc772036.aspx for details.
pnputil.exe -a c:\NDIS62\e1c62x64.inf
b) Instead of adding the driver to the installed Windows, you can also add the driver to the Windows ISO. This explains it nicly: http://www.thomasmaurer.ch/2011/01/a...tallation-iso/
Another link: http://emeneye.wordpress.com/2012/04...image-offline/
c) HDD Controller
- Windows 7/Windows 2008 R2 and other Windows versions missing SATA-Driver
http://support.microsoft.com/kb/922976 and some hints here http://think-like-a-computer.com/201...0007b-windows/
To resolve this issue yourself, enable the AHCI driver in the registry before you
change the SATA mode of the boot drive. To do this, follow these steps:
- Exit all Windows-based programs.
- Click Start, type regedit in the Start Search box, and then press ENTER.
- If you receive the User Account Control dialog box, click Continue.
- Locate and then click one of the following registry subkeys:
- In the pane on the right side, right-click Start in the Name
column, and then click Modify.
- In the Value data box, type 0, and then click OK.
- On the File menu, click Exit to close Registry Editor.
- If you need special storage drivers (e.g. SCSI, etc.) , you can add them as described in a).
d) Network Controller
Kimsufi uses Intel Desktop boards with 82579V network cards. Intel does not provide signed Drivers for any Windows Server edititon. You can download the latest or a not so late as suggested here.
For Windows 2008 R2 you will need to modify the e1c62x64.inf that you will find in c:\NDIS62 after you followed step a) to look like this (Reference: https://communities.intel.com/message/161157#161157 http://prueba345.wordpress.com/2011/...gabit-network/ http://www.missingremote.com/guide/i...s-motherboards ):
After you modified the inf-file you can add it to the driver store with
; DisplayName Section DeviceID
; ----------- ------- --------
%E1502NC.DeviceDesc% = E1502.6.1.1, PCI\VEN_8086&DEV_1502
%E1502NC.DeviceDesc% = E1502.6.1.1, PCI\VEN_8086&DEV_1502&SUBSYS_00008086
%E1502NC.DeviceDesc% = E1502.6.1.1, PCI\VEN_8086&DEV_1502&SUBSYS_00011179
%E1502NC.DeviceDesc% = E1502.6.1.1, PCI\VEN_8086&DEV_1502&SUBSYS_00021179
%E1503NC.DeviceDesc% = E1503.6.1.1, PCI\VEN_8086&DEV_1503
%E1503NC.DeviceDesc% = E1503.6.1.1, PCI\VEN_8086&DEV_1503&SUBSYS_00008086
%E1503NC.DeviceDesc% = E1503.6.1.1, PCI\VEN_8086&DEV_1503&SUBSYS_00011179
%E1503NC.DeviceDesc% = E1503.6.1.1, PCI\VEN_8086&DEV_1503&SUBSYS_00021179
; DisplayName Section DeviceID
; ----------- ------- --------
%E1502NC.DeviceDesc% = E1502, PCI\VEN_8086&DEV_1502
%E1502NC.DeviceDesc% = E1502, PCI\VEN_8086&DEV_1502&SUBSYS_00008086
%E1502NC.DeviceDesc% = E1502, PCI\VEN_8086&DEV_1502&SUBSYS_00011179
%E1502NC.DeviceDesc% = E1502, PCI\VEN_8086&DEV_1502&SUBSYS_00021179
%E1503NC.DeviceDesc% = E1503, PCI\VEN_8086&DEV_1503
%E1503NC.DeviceDesc% = E1503, PCI\VEN_8086&DEV_1503&SUBSYS_00008086
%E1503NC.DeviceDesc% = E1503, PCI\VEN_8086&DEV_1503&SUBSYS_00011179
%E1503NC.DeviceDesc% = E1503, PCI\VEN_8086&DEV_1503&SUBSYS_00021179
For Windows 2012 R2 the driver is in NDIS64 from step a) see: http://forum.kimsufi.com/showthread....l=1#post148664 . Direct adding in Windows 2012R2 didn't work, but it did after turning on testsigning of 3.b) below and rebooting. But this does not do the job, as in Windows 2008 R2. You have to boot into rescue mode from the Windows DVD in Qemu / VirtualBox / etc. and add the driver with
pnputil.exe -a c:\NDIS62\e1c62x64.inf
to Windows. Thanks to http://forum.kimsufi.com/showthread....l=1#post148664
Dism /Image:D:\ /Add-Driver /Driver:e1c64x64.inf
3. Prepare Windows for reboot on new hardware
[UPDATE 1.8.14] An installation of Windows 7 went smooth with these steps on KS-3. Install Windows 7 under Qemu. Download Intel driver and execute driver. Under "c:\user\username\Appdata\Local\Temp\Rar_something " you will find the extracted Intel network driver. Go to the proper subdirectory in Pro1000 with NDIS62. Use pnputil.exe from above to import driver to Windows. Then use fixit from http://support.microsoft.com/kb/922976 to ensure you can boot from SATA. Enable Remote Desktop. That's it. Don't update the system but reboot from HDD. You should be able to login. Now follow to Step 4 and customize Windows. [/UPDATE]
a) Do nothing special. It was reported that it would work, e.g. Windows 2012 R2 and Windows 8 and maybe also earlier versions. You should turn on remote desktop.
b) Turn on testsigning mode, so that Windows does not complain about not digitally signed drivers.
Turn on testsigning mode: http://www.sevenforums.com/drivers/2...tml#post960905
Set GroupPolicy (ignored on Windows 7 and higher)
bcdedit -set loadoptions DISABLE_INTEGRITY_CHECKS
bcdedit -set TESTSIGNING ON
1. Type GPEdit.MSC in Run dialog box and start Group Policy Edit.
2. Locate "Local Computer Policy\User Configuration\Administrative Templates\System\Driver Installation"
3. Change Device Drivers policy to enabled and choose Ignore for "installs unsigned drivers without asking"
c) Driver Signature Enforcement Overrider 1.3b
d) Enable Remote Desktop
e) Turn off Firewall, so be able to ping your server
f) Turn on debug mode with
This should turn off driver signature checking in Windows 2012 R2 and seemed to do the trick to get Intel 82579V driver installed.
[Note: I used b), d) on my Windows 2008 R2 installation I prepared in VirtualBox]
f) Run Sysprep on installation to let Windows scan for hardware changes
[UPDATE] unattend.xml files are language specific. You cannot just use a English version on a Spanish Windows.[/UPDATE]
1. Copy corresponding unattend.xml to c:\windows\panther and c:\windows\system32\sysprep
Note, you will need an unattend.xml that fits to your Windows DVD. Read further on how to create your own unattend.xml
2. start cmd as Administrator
3. cd \windows\system32\sysprep
4. sysprep /generalize /OOBE /shutdown /unattend:unattend.xml
Windows will shut down after sysprep
Backup and restore Windows installations
a) Qemu installation
You need to do nothing, since you installed Windows on your original server HDD
b) Home installation
Take a Linux LiveCD and boot the Windows virtual machine from the LiveCD (e.g. ScientificLinux 6.5). IMPORTANT: Don't boot up Windows after sysprep shut down your installation. The LiveCD won't mount your HDD. You can use any Linux System and add the VirtualBox HDD to it to get the same result. Just notice that you may need to change /dev/sda accordingly.
Backup Windows installation for later use onto server 220.127.116.11
Restore Windows from 18.104.22.168 onto server with linux rescue mode 22.214.171.124
dd if=/dev/sda bs=16M | xz | ssh -p 22 firstname.lastname@example.org "dd of=/root/windows.dd.xz bs=16M"
-p # ssh port
dd if=/root/windows.dd.xz bs=16M | ssh -p 22 email@example.com "xz -d | dd of=/dev/sda bs=16M"
-root@ # user to ssh into
Copy Windows to directly to server in rescue mode
-gzip -3 # so that you can compress datastream in realtime, on fast CPU you may use higher number
dd if=/dev/sda bs=16M | gzip -3 | ssh -p 22 firstname.lastname@example.org "gzip -d | dd of=/dev/sda bs=16M"
You are now ready to reboot your server from HDD.
Links I used: Qemu
Add Driver to Windows
Access hidden drivers in Windows
Autounattend.xml don't confuse with unattend.xml