Run and emulate Windows on a Raspberry Pi using QEMU

Most likely this is the first Russian-language manual on setting up QEMU on Raspberry.

Some time ago, I got the idea to run some kind of Windows system on my Raspberry Pi 2. At first I wanted to find out if it was possible to install it by simply writing to SDCARD and inserting it into the “raspberry”, but this was not given to be realized ...

After that I began to look for the possibility of starting through some emulators. I came across QEMU and began to delve into it. I tried to run the emulator for a very long time, almost everything that I found on the forums was written in English, and the information there was "at a minimum", and there were very few people who launched it. After several unsuccessful attempts to launch QEMU, I decided to write on w3bsit3-dns.com in the topic on Raspberry. They helped me there, and I successfully launched Windows 98 (almost perfect ...). I ran it on Raspibiane (Debian).

Let's start, open the terminal and prescribe this:

sudo apt-get install
sudo apt-get uprage
sudo apt-get install git zlib1g-dev libsdl1.2-dev libpixman-1-0 libpixman-1-dev

It is advisable to do all this through putty so that all the characters exactly match what is written.

We go further:

git clone git://git.qemu-project.org/qemu.git

The team begins to download the "insides" of the emulator, this process will not take much time.

image

After the file is downloaded and unpacked, a folder will appear (location / home /% username% / qemu), in which all the files that are necessary for the emulator to work will be located. After everything has downloaded and unpacked, we prescribe this:

cd qemu
./configure --target-list="i386-softmmu" --enable-sdl --prefix=/usr

The configuration process begins, it will not take much time (~ 30-60 seconds). Now we need to start the debugging process:

sudo make

Screenshot
After entering the command, debugging starts, it looks something like this:

image

Debugging can continue indefinitely, (~ 15-20 minutes). The last thing we need to do is tweak the configs and debug.

sudo nano /home/pi/qemu/tcg/arm/tcg-targe­t.c
sudo nano /home/pi/qemu/tcg/i386/tcg-targ­et.c

Screenshot
Sometimes when executing the above commands, the system creates a new file, then exit the editor and open the necessary configs with your hands.

image

Hold Ctrl + W, open the search bar, enter: static void tcg_out_addi. Change to static inline void tcg_out_addi. Go to the second config, also call the search bar and enter this text: static void tcg_out_opc and change it to static inline void tcg_out_opc. If you did not find any of the lines, then we do nothing, but simply close the config and perform the next step (in the first config, I did not find the desired line, but the emulator works fine for me).

If you are done with replacing strings, we continue to torment our “raspberry” further:

sudo make
sudo make install

Screenshot
image

We finished the emulator setup. Now let's move on to starting the system. As far as I know, the emulator supports these image formats:

.img - System image.
.vhd - Virtual "hard"
.iso - Disk image.

You can download images of the systems you are interested in here , there is also an instruction for creating your own system image.

I collected on Yandex.Disk all the images that run on QEMU and are taken from the theme, the link to which is given above. It is worth noting that the user password is written in the name of the Linux KDE image.

We proceed to launch the system. We write to the console:

qemu-system-i386 здесь тип образа (-hda, -fda, -cdrom) НазваниеВашегоОбраза.img -m Тут_Кол-во_ОЗУ_В_МБ(Без подчёркиваний разумеется).

If all settings are correct, loading of the system image should begin.

This photo, how to screen in Linux, I still have not mastered.

Result
image

image

QEMU can emulate not only i386 processors, but also other "platforms", more details:

ls /usr/bin/qemu*

This query invokes a list of QEMU commands:

qemu-system-i386 --help

Play around with the QEMU settings, I myself have not fully figured it out yet. It is worth considering that I started the system using the resources of only one core of the "raspberry", while the computer was loaded at 25-26% (running Win98). I read on the forums about the multithreaded work of QEMU with the system image, but I still did not understand how to make the emulator use the resources of more than one core. Again, play around with the settings and maybe you will understand how to set up multithreading (do not forget to write in the comments how you did it).

Also popular now: