https://wiki.archlinux.org/api.php?action=feedcontributions&user=Mex&feedformat=atomArchWiki - User contributions [en]2024-03-28T21:25:54ZUser contributionsMediaWiki 1.41.0https://wiki.archlinux.org/index.php?title=Talk:Kodi&diff=377817Talk:Kodi2015-06-07T20:07:55Z<p>Mex: /* lircd with XBMC */</p>
<hr />
<div>== Example guide for xbmc+MySQL ==<br />
<br />
I spend some considerable effort and time into drafting this section today in hopes in might lower the bar for others to implement the setup: [https://wiki.archlinux.org/index.php/XBMC#Sharing_a_database_across_multiple_nodes sharing a database across multiple nodes]. Please give it a try and provide some feedback, good or bad. [[User:Graysky|Graysky]] ([[User talk:Graysky|talk]]) 18:09, 21 September 2014 (UTC)<br />
<br />
:One observation: In the MySQL/MariaDB install section, you grant the 'kodi' user full permissions on all databases ('GRANT ALL ON *.*'). This is not great security for users who may be running other, private databases on the same server. Suggest this be changed to warn of this and/or to provide alternative instruction, i.e.<br />
::CREATE DATABASE ''<name-of-kodi-db>'';<br />
::GRANT ALL ON ''<name-of-kodi-db>''.* to 'kodi';<br />
:Unless Kodi ''needs'' to be able to perform any global actions (and I can't imagine why it would), this is a safer approach. If no objections I'll research this and edit the section in due course. [[User:Havin it|Havin it]] ([[User talk:Havin it|talk]]) 12:24, 4 April 2015 (UTC)<br />
<br />
== Pulseaudio and XBMC autostart ==<br />
<br />
Using the xbmc.service did not start pulseaudio. I ended up having to set a tty to autologin(getty) and start X in .bash_profile (using geforce integrated ION and HDIM out). [[User:Olivervbk|Olivervbk]] ([[User talk:Olivervbk|talk]]) 16:10, 28 January 2013 (UTC)<br />
<br />
:Yes, this is a known issue currently. See: [http://forum.xbmc.org/showthread.php?tid=201802 xbmc forum post] and [https://bbs.archlinux.org/viewtopic.php?id=185521 arch bbs post] and [https://bugs.freedesktop.org/show_bug.cgi?id=82447 systemd bugzilla]. Also, please sign your comments using four tilde characters. [[User:Graysky|Graysky]] ([[User talk:Graysky|talk]]) 07:08, 11 August 2014 (UTC)<br />
<br />
::This is now correct with {{AUR|xbmc-standalone-service}} version 1.3-1. [[User:Graysky|Graysky]] ([[User talk:Graysky|talk]]) 15:41, 9 September 2014 (UTC)<br />
<br />
== XBMC shutdown/reboot polkit rules ==<br />
<br />
I undid your modification to the XBMC page, as the polkit rule that enables poweroff and rebooting when using the systemd service is not present in the current package, as you implied in your modification comment. You can check yourself [https://www.archlinux.org/packages/community/x86_64/xbmc/ here]. Any reason you thought it was? I added a bug report mentioning this issue [https://bugs.archlinux.org/task/35729 here]. --[[User:Palmaway|Palmaway]] ([[User talk:Palmaway|talk]]) 03:31, 9 June 2013 (UTC)<br />
<br />
:It's not the exact udev rule, but placing the user in the 'power' group, and invoking the shutdown option works for me. This can be reversed by removing the user for the power group, logging out and back in, and invoking the shutdown option again. Now, the box does not go down; xbmc just exits. So functionally, that udev rule is not needed. [[User:Graysky|Graysky]] ([[User talk:Graysky|talk]]) 10:44, 9 June 2013 (UTC)<br />
<br />
::Are you running XBMC by enabling the systemd service? What you mention works if you run XBMC in other ways (xinit with autologin, direct execution...) but not for the systemd service, as in this case it will not register the session correctly therefore not enabling poklit. See this [https://bbs.archlinux.org/viewtopic.php?id=152113 forum post] for more details. --[[User:Palmaway|Palmaway]] ([[User talk:Palmaway|talk]]) 20:20, 9 June 2013 (UTC)<br />
<br />
== lircd with XBMC ==<br />
<br />
The section on getting an MCE remote to work with lircd under XBMC had been sitting there with a "this isn't the right way to use systemctl" warning for a while now. I was reinstalling lircd on my build, and figured I'd update this section. Fortunately, it seems that as far as I can tell, from lircd 0.9.1 onward, we don't need the custom systemctl service and the confusingly named config file for the service (which shared its name with lircd's own config file), as the lircd.socket service appeared to properly handle the /dev/lirc0 device when specified in lirc's own (also new) lirc_options.conf file. Shorter: using lircd.socket, everything now seems to work right out of the box. Would appreciate confirmation of this. --[[User:Slinkygn|Slinkygn]] ([[User talk:Slinkygn|talk]]) 15:37, 9 September 2014 (UTC)<br />
<br />
<br />
----<br />
<br />
The secion on setting up lircd with mce remote has this line, however the file isn't in the lirc pacakge.<br />
<br />
# ln -s /usr/share/lirc/mceusb/lircd.conf.mceusb /etc/lirc/lircd.conf<br />
<br />
--[[User:Mex|Mex]] ([[User talk:Mex|talk]]) 20:07, 7 June 2015 (UTC)<br />
<br />
== socket activation ==<br />
<br />
The text says to replace user in the files it teaches to the user to create with the running user but the file names are inconsistent with that statement. I don't have the inclination to test the socket method to fix it. [[User:Graysky|Graysky]] ([[User talk:Graysky|talk]]) 08:01, 22 November 2014 (UTC)<br />
<br />
It works for me as written. I'll go ahead and remove the warning.<br />
--[[User:Butler360|Butler360]] ([[User talk:Butler360|talk]]) 18:07, 9 January 2015 (UTC)<br />
<br />
== Controlling with a gamepad/joystick ==<br />
<br />
I tried a lot of things to in order to get a wireless Xbox 360 controller to work with XBMC, but the thing that finally made it work was going into System -> Settings -> System -> Input devices and checking the "Enable joystick and gamepad support" wich was disabled by default. May want to add a notice about this. [[User:Sivert|Sivert]] ([[User talk:Sivert|talk]]) 23:17, 6 December 2014 (UTC)<br />
<br />
<br />
: It's a wiki, dude. If you feel that you have some information others could benefit from, you are free to edit the main article to add it. [[User:Graysky|Graysky]] ([[User talk:Graysky|talk]]) 11:12, 8 December 2014 (UTC)</div>Mexhttps://wiki.archlinux.org/index.php?title=PHP&diff=271846PHP2013-08-20T12:29:48Z<p>Mex: </p>
<hr />
<div>[[Category:Programming language]]<br />
[[de:PHP]]<br />
[[es:PHP]]<br />
[[sr:PHP]]<br />
[http://www.php.net/ PHP] is a widely-used general-purpose scripting language that is especially suited for Web development and can be embedded into HTML.<br />
<br />
== Installation ==<br />
[[pacman|Install]] the {{Pkg|php}} package from the [[Official Repositories|official repositories]].<br />
<br />
A number of commonly used PHP extensions can also be found in the official repository:<br />
# pacman -Ss php-<br />
<br />
== Setup ==<br />
While PHP can be run standalone, it is typically used with http servers such as apache, nginx and lighttpd.<br />
* '''apache''': to setup PHP, Apache and MySQL, commonly known as LAMP, see [[LAMP]]<br />
* '''lighttpd''': see [[lighttpd]]<br />
* '''nginx''': see [[nginx]]<br />
<br />
== Configuration ==<br />
The main PHP confiuration file is well-documented and located at {{ic|/etc/php/php.ini}}.<br />
=== Extensions ===<br />
For {{Pkg|php-gd}} uncomment the line<br />
extension=gd.so<br />
<br />
== Zend Core + Apache ==<br />
Zend Core is the official PHP distribution provided by [http://www.zend.com zend.com]. It includes an installer/updater, zend optimizer, oracle support, and necessary libraries. However, it lacks support for postgresql, firebird, and odbc.<br />
* Install {{Pkg|mod_fcgid}}, a FastCGI module for Apache (the official one sucks).<br />
* Install Zend Core (official PHP distribution)<br />
** Uninstall the {{Pkg|php}} package.<br />
** Download and install zend core from [http://www.zend.com/products/zend_core] ; '''don't''' install the bundle apache or tell it to setup your web server. It always installs to {{ic|/usr/local/Zend/Core}} due to hard-coded path.<br />
** Create a script {{ic|/usr/local/bin/zendcore}} and create symlinks to ''php'', ''php-cgi'', ''pear'', ''phpize'' under ''/usr/local/bin''<br>{{ic|1=#!/bin/bash <br>export LD_LIBRARY_PATH="/usr/local/Zend/Core/lib"<br>exec /usr/local/Zend/Core/bin/`basename $0` "$@"}}<br />
* Setup Apache:<br />
** In {{ic|/etc/httpd/conf/httpd.conf}}, add<br>{{ic|LoadModule fcgid_module lib/apache/mod_fcgid.so<br><Directory /srv/http><br>AddHandler fcgid-script .php<br>FCGIWrapper /usr/local/bin/php-cgi .php<br>Options ExecCGI<br>Allow from all<br></Directory><br>SocketPath /tmp/fcgidsock<br>SharememPath /tmp/fcgidshm}}<br />
** Remember to change the Directory path<br />
* Disable Zend Optimizer (so you can use cache):<br />
** Edit {{ic|/etc/php.ini}}, uncomment the following line near the end of file:<br>{{ic|<nowiki>zend_extension_manager.optimizer="/usr/local/Zend/Core/lib/zend/optimizer"</nowiki>}}<br />
{{Out of date|Use APCu/OPcache https://www.archlinux.org/news/php-55-available-in-the-extra-repository/}}<br />
* Install APC (Alternative PHP Cache):<br />
** Run {{ic|pear install pecl.php.net/apc}} as superuser.<br />
** Edit {{ic|/etc/php.ini}}, add the line after ''"; Zend Core extensions..."'' (line 1205):<br>{{ic|<nowiki>extension=apc.so</nowiki>}}<br />
* Update Zend Core and/or install other components<br />
** Just run {{ic|/usr/local/Zend/Core/setup}}<br />
<br />
== Development tools ==<br />
<br />
=== Komodo ===<br />
Good integration for PHP+HTML+JavaScript. Lacks code formatting and unicode support in doc comments.<br />
<br />
[http://www.activestate.com/products/komodo_ide/ Komodo IDE] | [http://www.activestate.com/products/komodo_edit/ Komodo Edit (free)]<br />
<br />
Add custom encodings:<br />
*Edit {{ic|''KOMODO_INSTALL_DIR''/lib/mozilla/components/koEncodingServices.py}}, line 84, add:<br />
('cp950', 'Chinese(CP-950/Big5)', 'CP950', &#39;&#39;, 1,'cp950'),<br />
('cp936', 'Chinese(CP-936/GB2312)', 'CP936', &#39;&#39;, 1,'cp936'),<br />
('GB2312', 'Chinese(GB-2312)', 'GB2312', &#39;&#39;, 1,'GB2312'),<br />
....<br />
The format is (''encoding name in python'', ''description'', ''short description'', BOM, ''is ASCII-superset?'', ''font encoding'')<br />
<br />
=== Netbeans ===<br />
A complete IDE for many languages including PHP. Includes features like debugging, refactoring, code tempalting, autocomplete, XML features, and web design and development functionalities (very good CSS autocomplete functionality and PHP/JavaScript code notifications/tips).<br />
<br />
=== Eclipse PDT ===<br />
[http://www.zend.com/pdt Eclipse PDT] is not very complete at the current stage (v0.7); for instance, it cannot pop-up class list automatically when you type, though you can add custom auto-activation trigger keys.<br />
<br />
You would need other plugins for javascript support and DB query.<br />
<br />
=== Zend Studio ===<br />
[http://www.zend.com/products/studio/ Zend Studio] is the official PHP IDE, based on eclipse. The IDE has autocomplete, advanced code formatting, WYSIWYG html editor, refactoring, and all the eclipse features such as db access and version control integration and whatever you can get from other eclipse plugins.<br />
<br />
=== Aptana Studio ===<br />
A good IDE for programming in PHP and web development. The current version (3.2.2) does not have a PHP debugger.<br />
<br />
=== Zend Code Analyzer ===<br />
A PHP code analyzer from Zend Studio. The program is indispensable for any serious PHP coding.<br />
<br />
==== Installation ====<br />
* Download and install Zend Studio Neon<br />
* In the installation dir, run {{ic|find . -name "ZendCodeAnalyzer}} to get the path.<br />
* Copy ZendCodeAnalyzer to {{ic|/usr/local/bin/zca}}<br />
* Now you can remove zend studio; you won't need a key or anything.<br />
<br />
==== Vim Integration ====<br />
Add the following lines into your {{ic|.vimrc}}:<br />
autocmd FileType php setlocal makeprg=zca\ %<.php<br />
autocmd FileType php setlocal errorformat=%f(line\ %l):\ %m<br />
<br />
==== Eclipse Integration ====<br />
''Error Link'' plugin:<br />
* Symlink ''zca'' to ''build.zca'' (so Error Link can recognize it)<br />
* Install [http://sunshade.sourceforge.net/ Sunshade] plugin suite;<br />
* Preference -> Sunshade -> Error Link -> Add: ''{{ic|^(.*\.php)\(line (\d+)\): ()(.*)}}''<br />
* Run -> External Tools -> Open External Tools Dialog -> Select "Program" -> Clicn on "New":<br>Name: Zend Code Analyzer<br>Location: ''/usr/local/bin/build.zca''<br>Working Directory: ''${container_loc}''<br>Arguments: ''--recursive ${resource_name}''<br />
<br />
==== Komodo Integration ====<br />
Toolbox -> Add -> New Command:<br />
* Command: ''zca --recursive %F''<br />
* Run in: Command Output Tab<br />
* Parse output with: ''{{ic|^(?P<file>.+?)\(line (?P<line>\d+)\): (?P<content>.*)$}}''<br />
* Select ''Show parsed output as a list''<br />
<br />
== Troubleshooting ==<br />
=== PHP Fatal error: Class 'ZipArchive' not found ===<br />
Ensure the zip extension is enabled.<br />
{{hc|$ grep zip /etc/php/php.ini|2=<br />
extension=zip.so}}</div>Mexhttps://wiki.archlinux.org/index.php?title=Splashy&diff=266726Splashy2013-07-17T09:27:44Z<p>Mex: /* GNOME will not shut down */</p>
<hr />
<div>[[Category:Bootsplash]]<br />
[[es:Splashy]]<br />
[[ru:Splashy]]<br />
[[zh-CN:Splashy]]<br />
[http://alioth.debian.org/projects/splashy/ Splashy] is a userspace implementation of a splash screen for Linux systems. It provides a graphical environment during system boot using the Linux framebuffer layer via [http://www.directfb.org directfb].<br />
<br />
==Installation==<br />
<br />
Before you can use Splashy, you should enable [[Kernel Mode Setting]]. Please refer to the specific instructions for [[ATI#Kernel_mode-setting_.28KMS.29|ATI cards]], [[Intel#KMS_.28Kernel_Mode_Setting.29|Intel cards]] or [[Nouveau#KMS|Nvidia cards]]. <br />
<br />
Install {{AUR|splashy-full}} from the [[Arch User Repository]].<br />
<br />
You may also check out [https://bbs.archlinux.org/viewtopic.php?id=48978 this topic] on the [https://bbs.archlinux.org/ Arch Linux forum] for a repository you can add with working splashy packages.<br />
<br />
==Configuration==<br />
<br />
===/etc/rc.conf===<br />
<br />
Add this in {{ic|/etc/[[rc.conf]]}}:<br />
{{hc|/etc/rc.conf|2=SPLASH="splashy"}}<br />
<br />
===Including Splashy in initramfs===<br />
<br />
Add Splashy to the HOOKS array in {{ic|/etc/[[mkinitcpio.conf]]}}. It '''must''' be added ''after'' '''base''', '''udev''' and '''autodetect''' for it to work:<br />
{{hc|/etc/mkinitcpio.conf|2=HOOKS="base udev autodetect splashy [...]"}}<br />
<br />
For early KMS start add the module [[radeon]] (for radeon cards), [[Intel|i915]] (for intel cards) or [[nouveau]] (for nvidia cards) to the MODULES line in {{ic|/etc/mkinitcpio.conf}}:<br />
{{hc|/etc/mkinitcpio.conf|2=MODULES="i915"<br />
'''or'''<br />
MODULES="radeon"<br />
'''or'''<br />
MODULES="nouveau"}}<br />
<br />
Rebuild your kernel image (refer to the [[mkinitcpio]] article for more info):<br />
{{bc|# mkinitcpio -p [name of your kernel preset]}}<br />
<br />
===The kernel command line===<br />
<br />
You now need to set {{ic|quiet splash}} as you kernel command line parameters in your bootloader. See [[Kernel parameters]] for more info.<br />
<br />
===Themes===<br />
<br />
You can install {{AUR|splashy-themes}} from the AUR. After installing, look at the available themes like so:<br />
{{bc|ls /usr/share/splashy/themes}}<br />
<br />
The folder name is the theme name. Now change the theme to the one you want, eg.:<br />
{{bc|# splashy_config -s darch-white}}<br />
<br />
{{Note|Themes ending in 43 are of 4:3 aspect ratio - the others are widescreen.}}<br />
<br />
Rebuild your kernel image with:<br />
{{bc|# mkinitcpio -p [name of your kernel preset]}}<br />
<br />
and reboot.<br />
<br />
==Troubleshooting==<br />
<br />
===GNOME will not shut down===<br />
{{Out of date|Update for systemd.}}<br />
<br />
'''Problem:''' You are using Gnome, and starting GDM as a daemon, Splashy causes Gnome to not be able to properly shutdown/reboot.<br />
<br />
'''Fix:''' Remove '''gdm''' from DAEMONS in {{ic|/etc/rc.conf}}, and set it up in {{ic|[[Display manager#inittab method|/etc/inittab]]}}.</div>Mexhttps://wiki.archlinux.org/index.php?title=Talk:Mkinitcpio-btrfs&diff=246909Talk:Mkinitcpio-btrfs2013-02-09T15:19:58Z<p>Mex: /* Loop method not explained. */ new section</p>
<hr />
<div>== GPT-centric ==<br />
<br />
Why does this article make it seem as if GPT disks are the only option? btrfs is fine on MBR disks. In fact the entire section on GPT partitioning is generic and entirely irrelevant to using btrfs for root. The section should merely point to gpt or mbr partitioning pages.<br />
<br />
== rewrite ==<br />
I have removed the relevant "disputed, unconfirmed blabla" bits about syslinux. Updated the part on installing the syslinux bootloader and added links to relevant parts of the syslinux wiki.The system install part still needs some changes to reflect the use of the AIS (arch-chroot, pacstrap etc). --[[User:Flako|Flako]] ([[User talk:Flako|talk]]) 08:46, 1 September 2012 (UTC)<br />
<br />
== Loop method not explained. ==<br />
<br />
The page says...<br />
<br />
"Warning: If you need swap support, either make a partition, or use the loop method detailed below. DO NOT simply use a swap file! Doing so will corrupt your btrfs filesystem."<br />
<br />
However the loop method is not detailed below.<br />
<br />
--[[User:Mex|Mex]] ([[User talk:Mex|talk]]) 15:19, 9 February 2013 (UTC)</div>Mexhttps://wiki.archlinux.org/index.php?title=QEMU&diff=92030QEMU2010-01-13T13:05:28Z<p>Mex: </p>
<hr />
<div>[[Category:Emulators (English)]]<br />
[[Category:HOWTOs (English)]]<br />
{{i18n_links_start}}<br />
{{i18n_entry|English|QEMU}}<br />
{{i18n_entry|简体中文|Arch QEMU设置 (简体中文)}}<br />
{{i18n_links_end}}<br />
<br />
Qemu is a fast cpu emulator using dynamic translation to achieve good emulation speed. Unlike VMware and Win4Lin, it emulates the cpu instead of only virtualizing the computer. This means that it is considerably slower, but on the other hand it is much more portable, stable and secure. Plus it is open source. It is great solution if you want to run some simple Windows applications like MS Office on a fast PC and you want to ensure maximum compatibility. It is also a great tool for operating system development. This HOWTO describes how to set up the emulator and install Windows 9x/2000 under it.<br />
<br />
Qemu has the homepage at http://bellard.org/qemu/.<br />
<br />
<br />
<br />
=== Choosing Windows version===<br />
Qemu can run any version of Windows. However, 98, Me and XP will run at quite a low speed. You should choose either Windows 95 or Windows 2000. Surprisingly, 2000 seems to run faster than 98. The fastest one is 95, which can from time to time make you forget that you are running an emulator :)<br />
<br />
If you own both Win95 and win98/winme, then 98lite (from http://www.litepc.com) might be worth trying. It decouples Internet Explorer from operating system and replaces it with original Windows 95 Explorer. It also enables you to do a minimal Windows installation, without all the bloat you normally cannot disable. This might be the best option, because you get the smallest, fastest and most stable Windows this way.<br />
<br />
=== Installing QEMU ===<br />
<br />
QEMU is available as a package in the [extra] repository. To install it, add the extra repo to /etc/pacman.conf, and do<br />
<pre><br />
pacman -Sy qemu<br />
</pre><br />
You can also install the optional kernel accelerator module KQEMU, which can also be found in the [extra] repository.<br />
<pre><br />
pacman -Sy kqemu<br />
</pre><br />
<br />
=== Creating the hard disk image===<br />
To run qemu you will probably need a hard disk image. This is a file which stores the contents of the emulated hard disk.<br />
<br />
Use the command:<br />
<pre><br />
qemu-img create -f qcow2 win.qcow 4G<br />
</pre><br />
to create the image file named "win.qcow". The "4G" parameter specifies the size of the disk - in this case 4 GB. You can use suffix M for megabytes (for example "256M"). You shouldn't worry too much about the size of the disk - the qcow2 format compresses the image so that the empty space doesn't add up to the size of the file.<br />
<br />
=== Preparing the installation media===<br />
The installation CD-ROM/floppy shouldn't be mounted, because Qemu accesses the media directly. It is a good idea to dump CD-ROM and/or floppy to a file, because it both improves performance and doesn't require you to have direct access to the devices (that is, you can run Qemu as a regular user). For example, if the CD-ROM device node is named "/dev/cdrom", you can dump it to a file with the command:<br />
<pre><br />
dd if=/dev/cdrom of=win98icd.iso<br />
</pre><br />
<br />
Do the same for floppies:<br />
<br />
<pre><br />
dd if=/dev/fd of=win95d1.img<br />
...<br />
</pre><br />
<br />
When you need to replace floppies within qemu, just copy the contents of one floppy over another. For this reason, it is useful to create a special file that will hold the current floppy:<br />
<br />
<pre><br />
touch floppy.img<br />
</pre><br />
<br />
=== Installing the operating system===<br />
<br />
This is the first time you will need to start the emulator.<br />
One thing to keep in mind: when you click inside qemu window, the mouse pointer is grabbed. To release it press Ctrl+Alt.<br />
<br />
If you need to use a bootable floppy, run Qemu with:<br />
<pre><br />
qemu -cdrom [[cdrom''image]] -fda [[floppy''image]] -boot a [[hd_image]]<br />
</pre><br />
or if you are on a x86_64 system (will avoid many problems afterwards):<br />
<pre><br />
qemu-system-x86_64 -cdrom [[cdrom''image]] -fda [[floppy''image]] -boot a [[hd_image]]<br />
</pre><br />
<br />
If your CD-ROM is bootable or you are using iso files, run Qemu with:<br />
<pre><br />
qemu -cdrom [[cdrom''image]] -boot d [[hd''image]]<br />
</pre><br />
or if you are on a x86_64 system (will avoid many problems afterwards):<br />
<pre><br />
qemu-system-x86_64 -cdrom [[cdrom''image]] -boot d [[hd''image]]<br />
</pre><br />
Now partition the virtual hard disk, format the partitions and install the OS.<br />
<br />
A few hints:<br />
# If you are using Windows 95 boot floppy, then choosing SAMSUNG as the type of CD-ROM seems to work<br />
# There are problems when installing Windows 2000. Windows setup will generate a lot of edb*.log files, one after the other containing nothing but blank spaces in C:\WINNT\SECURITY which quickly fill the virtual harddisk. A workaround is to open a Windows command prompt as early as possible during setup (by pressing Shift-F10) which will allow you to remove these log files as they appear by typing :<br />
<pre><br />
del %windir%\security\*.log<br />
</pre><br />
<br />
NOTE: According to the official QEMU website, "Windows 2000 has a bug which gives a disk full problem during its installation. When installing it, use the `-win2k-hack' QEMU option to enable a specific workaround. After Windows 2000 is installed, you no longer need this option (this option slows down the IDE transfers)."<br />
<br />
=== Running the system===<br />
<br />
To run the system simply type:<br />
<pre><br />
qemu [hd_image]<br />
</pre><br />
<br />
A good idea is to use overlay images. This way you can create hard disk image once and tell Qemu to store changes in external file.<br />
You get rid of all the instability, because it is so easy to revert to previous system state :)<br />
<br />
To create an overlay image, type:<br />
<pre><br />
qemu-img create -b [[base''image]] -f qcow [[overlay''image]]<br />
</pre>2<br />
Substitute the hard disk image for base_image (in our case win.qcow). After that you can run qemu with:<br />
<pre><br />
qemu [overlay_image]<br />
</pre><br />
or if you are on a x86_64 system:<br />
<pre><br />
qemu-system-x86_64 [overlay_image]<br />
</pre><br />
and the original image will be left untouched. One hitch, the base image cannot be renamed or moved, the overlay remembers the base's full path.<br />
<br />
=== Moving data between host and guest OS===<br />
<br />
If you have servers on your host OS they will be accessible with the ip-address 10.0.2.2 without any further configuration. So you could just FTP or SSH, etc to 10.0.2.2 from windows to share data, or if you would like to use samba:<br />
<br />
==== Samba====<br />
<br />
Qemu supports SAMBA which allows you to mount host directories during the emulation. It seems that there is an incompatibility with SAMBA 3.x. and some versions of qemu. But at least with a current snapshot of qemu it should be working.<br />
<br />
First, you need to have a working samba installation. Then add the following section to your smb.conf:<br />
<pre><br />
[qemu]<br />
comment = Temporary file space<br />
path = /tmp<br />
read only = no<br />
public = yes<br />
</pre><br />
<br />
Now start qemu with:<br />
<pre><br />
qemu [hd_image] -smb qemu<br />
</pre><br />
<br />
Then you should be able to access your host's smb-server with the ip-address 10.0.2.2. If you're running Win9x as guest OS, you may need to add<br />
<pre><br />
10.0.2.2 smbserver<br />
</pre><br />
to c:\windows\lmhosts (Win9x has Lmhosts.sam as a SAMple, rename it!).<br />
<br />
==== Mounting the hard disk image====<br />
<br />
Fortunately there is a way to mount the hard disk image with a loopback device. Login as root, make a temporary directory and mount the image with the command:<br />
<pre><br />
mount -o loop,offset=32256 [[hd''image]] [[tmp''dir]]<br />
</pre><br />
Now you can copy data in both directions. When you are done, umount with:<br />
<pre><br />
umount [hd_image]<br />
</pre><br />
The drawback of this solution is that you cannot use it with qcow images (including overlay images). So you need to create you images without \"-f qcow\" option. Tip: create a second, raw harddrive image. This way you'll be able to transfer data easily and use qcow overlay images for the primary drive.<br />
<br />
REMEMBER: never run qemu when the image is mounted!<br />
<br />
==== Using any real partition as the single primary partition of a hard disk image ====<br />
<br />
Sometimes, you may wish to use one of your system partition from within qemu (for instance, if you wish booting both your real machine or qemu using a given partition as root). You can do this using software RAID in linear mode (you need the linear.ko kernel driver) and a loopback device: the trick is to dynamically prepend a master boot record (MBR) to the real partition you wish to embed in a qemu raw disk image.<br />
<br />
Suppose you have a plain, unmounted /dev/hdaN partition with some filesystem on it you wish to make part of a qemu disk image. First, you create some small file to hold the MBR:<br />
<br />
dd if=/dev/zero of=/path/to/mbr count=32<br />
<br />
Here, a 16 KB (32 * 512 bytes) file is created. It is important not to make it too small (even if the MBR only needs a single 512 bytes block), since the smaller it will be, the smaller the chunk size of the software RAID device will have to be, which could have an impact on performance. Then, you setup a loopback device to the MBR file:<br />
<br />
losetup -f /path/to/mbr<br />
<br />
Let's assume the resulting device is /dev/loop0, because we woudn't already have been using other loopbacks. Next step is to create the "merged" MBR + /dev/hdaN disk image using software RAID:<br />
<br />
modprobe linear<br />
mdadm --build --verbose /dev/md0 --chunk=16 --level=linear --raid-devices=2 /dev/loop0 /dev/hdaN<br />
<br />
The resulting /dev/md0 is what you will use as a qemu raw disk image (don't forget to set the permissions so that the emulator can access it). The last (and somewhat tricky) step is to set the disk configuration (disk geometry and partitions table) so that the primary partition start point in the MBR matches the one of /dev/hdaN inside /dev/md0 (an offset of exactly 16 * 512 = 16384 bytes in this example). Do this using fdisk on the host machine, not in the emulator: the default raw disc detection routine from qemu often results in non kilobyte-roundable offsets (such as 31.5 KB, as in the previous section) that cannot be managed by the software RAID code. Hence, from the the host:<br />
<br />
fdisk /dev/md0<br />
<br />
Press 'x' to enter the expert menu. Set number of 's'ectors per track so that the size of one<br />
cylinder matches the size of your mbr file. For two heads and the sector size is 512, the number of<br />
sectors per track should be 16, so we get cylinders of size 2x16x512=16k. Now, press 'r' to return<br />
to the main menu. Press 'p' and check that now the cylinder size is 16k.<br />
Now, create a single primary partition corresponding to /dev/hdaN. It should start at cylinder 2 and end at the end of the disk (note that the number of cylinders now differs from what it was when you entered fdisk. Finally, 'w'rite the result to the file: you are done. You know have a partition you can mount directly from your host, as well as part of a qemu disk image: <br />
<br />
qemu -hdc /dev/md0 [...]<br />
<br />
You can of course safely set any bootloader on this disk image using qemu, provided the original /boot/hdaN partition contains the necessary tools.<br />
<br />
=== Optimizing Windows 9x CPU usage===<br />
<br />
Windows 9x doesn't use hlt instruction, so the emulator always eats up 100% CPU even if no computation is being done. Grab the file http://www.user.cityline.ru/~maxamn/amnhltm.zip, unpack it, copy it to the image and run the .bat file.<br />
<br />
=== Using the QEmu Accelerator Module===<br />
<br />
{{Note|This method is no longer supported. The KVM module should be used instead.}}<br />
<br />
The developers of qemu have created an optional kernel module to accelerate qemu to sometimes near native levels. This should be loaded with the option<br />
major=0<br />
to automate the creation of the required /dev/kqemu device. The following command<br />
echo "options kqemu major=0" >> /etc/modprobe.d/modprobe.conf<br />
will amend modprobe.conf to ensure that the module option is added every time the module is loaded.<br />
<br />
Append kqemu to the list of modules in /etc/rc.conf to have it loaded the next time the your system starts. To load it now without rebooting, do the following as root<br />
modprobe kqemu<br />
<br />
If you are using Linux, Windows 2000 or Windows XP as guest OS, start qemu with the command line option<br />
qemu [...] -kernel-kqemu<br />
or, if you are on a x86_64 system (will not work otherwise):<br />
qemu-system-x86_64 [...] -kernel-kqemu<br />
This enables full virtualization and thus improves speed considerably.<br />
<br />
=== Using the Kernel-based Virtual Machine ===<br />
<br />
[[Kvm]] is a full virtualization solution for Linux on x86 hardware containing virtualization extensions (Intel VT or AMD-V). It consists of a loadable kernel module, kvm.ko, that provides the core virtualization infrastructure and a processor specific module, kvm-intel.ko or kvm-amd.ko. Using [[Kvm]], one can run multiple virtual machines running unmodified Linux or Windows images. Each virtual machine has private virtualized hardware: a network card, disk, graphics adapter, etc.<br />
<br />
This technology requires an x86 machine running a recent Linux kernel on an Intel processor with VT (virtualization technology) extensions, or an AMD processor with SVM extensions. It is included in the mainline linux kernel since 2.6.20.<br />
<br />
For versions of QEMU prior to 0.10.2-1 use the <code>qemu-kvm</code> executable. For 0.10.2-1 and later, use <code>qemu --enable-kvm</code>.<br />
<br />
To take advantage of [[Kvm]], you simply need a compatible processor (the following command must return something on screen)<br />
<br />
egrep '^flags.*(vmx|svm)' /proc/cpuinfo<br />
<br />
And load the appropriate module from your rc.conf<br />
<br />
* For Intel® processors add this module to your MODULES array in /etc/rc.conf<br />
<br />
kvm-intel<br />
<br />
* for AMD® processors add this module to your MODULES array in /etc/rc.conf<br />
<br />
kvm-amd<br />
<br />
Also, you will need to yourself to the group 'kvm'.<br />
<br />
===Basic Networking===<br />
To add basic networking to your virtual machine, you may have to simply load qemu with those options: -net nic,vlan=1 -net user,vlan=1 . For example, to load a cdrom, you could use:<br />
qemu -kernel-kqemu -no-acpi -net nic,vlan=1 -net user,vlan=1 -cdrom dsl-4.3rc1.iso<br />
<br />
=== Tap Networking with QEMU ===<br />
<br />
==== Basic Idea ====<br />
<br />
Tap networking in QEMU lets virtual machines register themselves as though with separate ethernet adapters and have their traffic bridged directly onto your local area network. This is sometimes very desireable, if you want your virtual machines to be able to talk to each other, or for other machines on your LAN to talk to virtual machines.<br />
<br />
==== Security Warning ====<br />
<br />
You probably <b>should not</b> use this networking method if your host Arch machine is directly on the Internet. It can expose your virtual machines directly to attack!<br />
<br />
In general, Arch disclaims any responsibility for security implications (or implications of any kind, really) from following these instructions.<br />
<br />
==== Nitty Gritty ====<br />
<br />
To set all this up, you'll need to install the following packages:<br />
bridge-utils (for brctl, to manipulate bridges)<br />
uml_utilities (for tunctl, to manipulate taps)<br />
sudo (for manipulating bridges and tunnels as root)<br />
<br />
Then you need to take the following steps:<br />
<br />
1. Replace your normal ethernet adapter with a bridge adapter and bind your normal ethernet adapter to it. First install the bridging module:<br />
<br />
# modprobe bridge<br />
<br />
2. Configure your bridge <code>br0</code> to have your real ethernet adapter (herein assumed <code>eth0</code>) in it, in <code>/etc/conf.d/bridges</code>:<br />
bridge_br0="eth0"<br />
BRIDGE_INTERFACES=(br0)<br />
<br />
3. Change your networking configuration so that you just bring up your real ethernet adapter without configuring it, allowing real configuration to happen on the bridge interface. In <code>/etc/rc.conf</code>:<br />
<br />
eth0="eth0 up"<br />
br0="dhcp"<br />
INTERFACES=(eth0 br0)<br />
<br />
Remember, especially if you're doing DHCP, it's essential that the bridge comes up AFTER the real adapter, otherwise the bridge won't be able to talk to anything to get a DHCP address!<br />
<br />
4. Install the tunnel/tap module:<br />
<br />
# modprobe tun<br />
<br />
5. Install the script that QEMU uses to bring up the tap adapter in <code>/etc/qemu-ifup</code> with root:kvm 750 permissions:<br />
<br />
#!/bin/sh<br />
<br />
echo "Executing /etc/qemu-ifup"<br />
echo "Bringing up $1 for bridged mode..."<br />
sudo /sbin/ifconfig $1 0.0.0.0 promisc up<br />
echo "Adding $1 to br0..."<br />
sudo /usr/sbin/brctl addif br0 $1<br />
sleep 2<br />
<br />
6. Use <code>visudo</code> to add the following to your <code>sudoers</code> file:<br />
<br />
Cmnd_Alias QEMU=/sbin/ifconfig,/sbin/modprobe,/usr/sbin/brctl,/usr/bin/tunctl<br />
%kvm ALL=NOPASSWD: QEMU<br />
<br />
7. Make sure the user(s) wishing to use this new functionality are in the kvm group. Exit and log in again if necessary.<br />
<br />
8. You launch qemu using the following <code>run-qemu</code> script:<br />
<br />
USERID=`whoami`<br />
IFACE=`sudo tunctl -b -u $USERID`<br />
<br />
qemu-kvm -net nic -net tap,ifname="$IFACE" $*<br />
<br />
sudo tunctl -d $IFACE &> /dev/null<br />
<br />
9. Add <code>bridge</code> and <code>tun</code> to your <code>MODULES</code> line in <code>/etc/rc.conf</code>.<br />
<br />
=== Front-ends for Qemu ===<br />
<br />
There are a few GUI Front-ends for Qemu:<br />
<br />
* community/qemu-launcher<br />
* community/qemulator<br />
* community/qtemu<br />
<br />
===Keyboard seems broken / Arrow keys don't work===<br />
<br />
Should you find that some of your keys do not work or "press" the wrong key (in particular, the arrow keys), you likely need to specify your keyboard layout as an option. The keyboard layouts can be found in /usr/share/qemu/keymaps.<br />
<br />
<pre><br />
qemu -k [keymap] [disk_image]<br />
</pre><br />
<br />
=== External links ===<br />
* [http://kidsquid.com/cgi-bin/moin.cgi/QEMUMenu QEMUMenu for Windows].<br />
* [http://mychael.gotdns.com/blog/2006/12/14/qemu-setup/ Network bridging setup for QEMU]</div>Mex