Difference between pages "Windows 7 Virtualization with KVM" and "Package:Rutorrent"

(Difference between pages)
(KVM Setup)
 
m (more details)
 
Line 1: Line 1:
This page describes how to set up Funtoo Linux to run Windows 7 Professional 32-bit within a KVM virtual machine. KVM is suitable for running Windows 7 for general desktop application use. It does not provide 3D support, but offers a nice, high-performance virtualization solution for day-to-day productivity applications. It is also very easy to set up.
+
{{Ebuild
 +
|Summary=ruTorrent is a front-end for the popular Bittorrent client rTorrent
 +
|CatPkg=www-apps/rutorrent
 +
|Homepage=http://code.google.com/p/rutorrent/
 +
}}
  
== Introduction ==
+
rutorrent is a front end to {{package|net-p2p/rtorrent}} and is designed to look like utorrent =D
  
KVM is a hardware-accelerated full-machine hypervisor and virtualization solution included as part of kernel 2.6.20 and later. It allows you to create and start hardware-accelerated virtual machines under Linux using the QEMU tools.
+
{{console|body=###i## emerge www-apps/rutorrent}}
  
[[File:Windows7virt.png|400px|Windows 7 Professional 32-bit running within qemu-kvm]]
+
===prereqs===
 +
*Install your web server {{package|www-servers/nginx}}, and get {{package|dev-lang/php}} with the fpm use flag running first.
 +
*you must turn on scgi_pass within rtorrents.
  
== KVM Setup ==
+
===configuration===
 +
first figure out what php you're using
  
If you are using an automatically-built kernel, it is likely that kernel support for KVM is already available.
+
{{console|body=###i##eselect php list fpm
 +
[1]  php5.5 *
 +
###i## eselect php list cgi
 +
[1]  php5.5 *
 +
###i## eselect php list apache2
 +
[1]  php5.5 *
 +
###i## eselect php list cli
 +
[1]  php5.5 *
 +
}}
  
If you build KVM from scratch, please see the following page for detailed instructions on how to do this. Then come back here:
+
edit the respective php.ini
  
* [[KVM]] - Instructions on how to configure your system for KVM
+
were going to configure for nginx.
  
{{fancyimportant|Before using KVM, be sure that your user account is in the <tt>kvm</tt> group. You will need to use a command such as <tt>vigr</tt> as root to do this, and then log out and log back in for this to take effect.}}
+
=== optional security lock down stuff ===
 +
{{warning|possibly broken, untested}}
 +
Edit the open_basedir in
 +
/etc/php/fpm-php5.5/php.ini
 +
{{file|name=/etc/php/fpm-php5.5/php.ini|lang=|desc=php basedir|body=
 +
open_basedir = /var/www/localhost/htdocs/rutorrent/conf:/var/www/localhost/htdocs/rutorrent/php:/var/www/localhost/htdocs/rutorrent/
 +
}}
  
== Windows 7 ISO Images ==
+
=== nginx config===
 +
{{file|name=/etc/nginx/sites-available/localhost|lang=|desc=nginx configuration|body=
 +
server {
 +
listen 127.0.0.1:80;
 +
server_name localhost;
 +
access_log /var/log/nginx/localhost.access_log main;
 +
error_log /var/log/nginx/localhost.error_log info;
 +
root /var/www/localhost/htdocs;
 +
index index.php index.cgi index.htm index.html;
 +
autoindex on;
  
In this tutorial, we are going to install Windows 7 Professional, 32-bit Edition. Microsoft provides a free download of the ISO DVD image, but this does require a valid license key for installation. You can download Windows 7 Professional, 32 bit at the following location:
+
        location ~ \.php$ {
 +
                fastcgi_pass 127.0.0.1:9000;
 +
include fastcgi.conf;
 +
                #fastcgi_pass unix:/var/run/php5-fpm.sock;
 +
        }
  
http://msft-dnl.digitalrivercontent.net/msvista/pub/X15-65804/X15-65804.iso
+
          location /rutorrent {
 +
              include scgi_params;
 +
              scgi_pass localhost:5000;
 +
          }
 +
}
 +
}}
  
In addition, it's highly recommended that you download "VirtIO" drivers produced by Red Hat. These drivers are installed under Windows and significantly improve Windows 7 network and disk performance. You want to download the ISO file (not the ZIP file) at the following location:
+
then start nginx
 +
{{console|body=###i## /etc/init.d/nginx restart}}
  
http://alt.fedoraproject.org/pub/alt/virtio-win/latest/images/
+
point browser to
  
== Create Raw Disk ==
+
http://127.0.0.1/rutorrent
  
In this tutorial, we are going to create a 30GB raw disk image for Windows 7. Raw disk images offer better performance than the commonly-used QCOW2 format. Do this as a regular user:
+
or
  
<console>
+
http://localhost/rutorrent
$ ##i##cd
+
$ ##i##qemu-img create -f raw win7.img 30G
+
</console>
+
  
We now have an empty virtual disk image called <tt>win7.img</tt> in our home directory.
+
{{note|tested without rtorrent running, and without editing the php.ini, web app runs fine.}}
  
== QEMU script ==
 
  
Now, we'll create the following script to start our virtual machine and begin Windows 7 installation. Note that this script assumes that the two ISO files downloaded earlier were placed in the user's <tt>Downloads</tt> directory. Adjust paths as necessary if that is not the case. Also be sure to adjust the following parts of the script:
 
  
* Adjust the name of <tt>VIRTIMG</tt> to match the exact name of the VirtIO ISO image you downloaded earlier
+
{{PageNeedsUpdates}}
* Adjust the <tt>smp</tt> option to use the number of CPU cores and threads (if your system has hyperthreading) of your Linux system's CPU.
+
{{EbuildFooter}}
 
+
Use your favorite text editor to create the following script. Name it something like <tt>vm.sh</tt>:
+
 
+
<syntaxhighlight lang="bash">
+
#!/bin/sh
+
export QEMU_AUDIO_DRV=alsa
+
DISKIMG=~/win7.img
+
WIN7IMG=~/Downloads/X15-65804.iso
+
VIRTIMG=~/Downloads/virtio-win-0.1-74.iso
+
qemu-kvm --enable-kvm -drive file=${DISKIMG},if=virtio -m 2048 \
+
-net nic,model=virtio -net user -cdrom ${WIN7IMG} \
+
-drive file=${VIRTIMG},index=3,media=cdrom \
+
-rtc base=localtime,clock=host -smp cores=2,threads=4 \
+
-usbdevice tablet -soundhw ac97 -cpu host -vga vmware
+
</syntaxhighlight>
+
 
+
Now, make the script executable:
+
 
+
<console>
+
$ ##i##chmod +x vm.sh
+
</console>
+
 
+
Here is a brief summary of what the script does. It starts the <tt>qemu-kvm</tt> program and instructs it to use KVM to accelerate virtualization. The system disk is the 30GB raw image you created, and we tell QEMU to use "virtio" mode for this disk, as well as "virtio" for network access. This will require that we install special drivers during installation to access the disk and enable networking, but will give us better performance.
+
 
+
To assist us in installing the VirtIO drivers, we have configured the system with two DVD drives -- the first holds the Windows 7 installation media, and the second contains the VirtIO driver ISO that we will need to access during Windows 7 installation.
+
 
+
The <tt>-usbdevice tablet</tt> option will cause our mouse and keyboard interaction with our virtual environment to be intuitive and easy to use.
+
 
+
== Starting Windows 7 Installation ==
+
 
+
Now, it's time to start Windows 7 installation. Run <tt>vm.sh</tt> as follows:
+
 
+
<console>
+
$ ##i##./vm.sh
+
</console>
+
 
+
Windows 7 installation will begin. During the installation process, you will need to enter a valid license key, and also load ''both'' VirtIO drivers from Red Hat when prompted (Browse to the second DVD, then win7 directory, then x86).
+
 
+
After some time, Windows 7 installation will complete. You will be able to perform Windows Update, as by default, you will have network access if your host Linux system has network access.
+
 
+
Enjoy your virtualized Windows 7 system!
+
 
+
[[Category:Tutorial]]
+
[[Category:First Steps]]
+
[[Category:Virtualization]]
+
[[Category:KVM]]
+

Revision as of 06:47, March 8, 2015

www-apps/rutorrent


Source Repository:Gentoo Portage Tree
Homepage

Summary: ruTorrent is a front-end for the popular Bittorrent client rTorrent


News

Drobbins

How We're Keeping You At the Center of the Funtoo Universe

Read about recent developments that keep you, our users, at the forefront of our focus as Funtoo moves forward.
10 April 2015 by Drobbins
Mgorny

New OpenGL management in Funtoo

Funtoo is switching to an improved system for managing multiple OpenGL providers (Mesa/Xorg, AMD and NVIDIA). The update may involve blockers and file collisions.
30 March 2015 by Mgorny
Drobbins

Subarch Profiles are coming...

Subarch profiles are on their way! Learn more here.
29 March 2015 by Drobbins
View More News...

Rutorrent

Tip

This is a wiki page. To edit it, Create a Funtoo account. Then log in and then click here to edit this page. See our editing guidelines to becoming a wiki-editing pro.


rutorrent is a front end to Rtorrent and is designed to look like utorrent =D

# emerge www-apps/rutorrent


prereqs

  • Install your web server Nginx, and get PHP with the fpm use flag running first.
  • you must turn on scgi_pass within rtorrents.

configuration

first figure out what php you're using

#eselect php list fpm
[1]   php5.5 *
# eselect php list cgi
[1]   php5.5 *
# eselect php list apache2
[1]   php5.5 *
# eselect php list cli
[1]   php5.5 *


edit the respective php.ini

were going to configure for nginx.

optional security lock down stuff

Warning

possibly broken, untested

Edit the open_basedir in /etc/php/fpm-php5.5/php.ini

/etc/php/fpm-php5.5/php.ini - php basedir
open_basedir = /var/www/localhost/htdocs/rutorrent/conf:/var/www/localhost/htdocs/rutorrent/php:/var/www/localhost/htdocs/rutorrent/

nginx config

/etc/nginx/sites-available/localhost - nginx configuration
server {
	listen 127.0.0.1:80;
	server_name localhost;
	access_log /var/log/nginx/localhost.access_log main;
	error_log /var/log/nginx/localhost.error_log info;
	root /var/www/localhost/htdocs;
	index index.php index.cgi index.htm index.html;
	autoindex on;

        location ~ \.php$ {
                fastcgi_pass 127.0.0.1:9000;
		include fastcgi.conf;
                #fastcgi_pass unix:/var/run/php5-fpm.sock;
        }

           location /rutorrent {
               include scgi_params;
               scgi_pass localhost:5000;
           }
}

then start nginx

# /etc/init.d/nginx restart


point browser to

http://127.0.0.1/rutorrent

or

http://localhost/rutorrent

Note

tested without rtorrent running, and without editing the php.ini, web app runs fine.