Difference between revisions of "Build QEMU with SPICE video support for an OS X VM"

From The AirPort Wiki
Jump to: navigation, search
 
(11 intermediate revisions by one user not shown)
Line 1: Line 1:
 
In this tutorial / guide I hope to show one how to build QEMU with SPICE support, so one can use the qxl video driver when running a OS X under a QEMU Virtual Machine.
 
In this tutorial / guide I hope to show one how to build QEMU with SPICE support, so one can use the qxl video driver when running a OS X under a QEMU Virtual Machine.
  
My current setup is the following, MBPr running archlinux with the most recent packages.  (I run pacman -Syu probably once a week).  However when I installed QEMU from AUR there wasn't support for SPICE at the time, so I decided to build QEMU from git source to include support for SPICE.
+
My current setup is the following, MBPr running archlinux with the most recent packages.  (I run <code>pacman -Syu</code> probably once a week).  However when I installed QEMU from AUR there wasn't support for SPICE at the time, so I decided to build QEMU from git source to include support for SPICE.
  
I chose to install the following packages in /opt/local to keep this separate from the archlinux packages.
+
I chose to install the following packages in <code>/opt/local</code> to keep this separate from the archlinux packages.
  
1) mkdir /opt/local
+
<source lang="bash">
2) mkdir /opt/src
+
mkdir /opt/local
3) cd /opt/src
+
mkdir /opt/src
4) git clone git://git.qemu-project.org/qemu.git
+
cd /opt/src
Note: QEMU is almost updated daily, so after cloning the repo to your local box, running git pull will get one updated to the latest greatest version of QEMU.
+
git clone git://git.qemu-project.org/qemu.git
5) cd /opt/src
+
'''Note:''' QEMU is almost updated daily, so after cloning the repo to your local box, running git pull will get one updated to the latest greatest version of QEMU.
6) git clone git://cgit.freedesktop.org/spice/spice-protocol
+
cd /opt/src
7) git clone git://cgit.freedesktop.org/spice/spice
+
git clone git://cgit.freedesktop.org/spice/spice-protocol
8) wget http://downloads.us.xiph.org/releases/celt/celt-0.5.1.3.tar.gz
+
git clone git://cgit.freedesktop.org/spice/spice
9) tar xvzf celt-0.5.1.3.tar.gz
+
wget http://downloads.us.xiph.org/releases/celt/celt-0.5.1.3.tar.gz
10) export PKG_CONFIG_PATH=$INST_ROOT/lib/pkgconfig:$INST_ROOT/share/pkgconfig
+
tar xvzf celt-0.5.1.3.tar.gz
 
+
export PKG_CONFIG_PATH=$INST_ROOT/lib/pkgconfig:$INST_ROOT/share/pkgconfig
11) cd $SRC_ROOT/spice-protocol
+
cd $SRC_ROOT/spice-protocol
 +
./autogen.sh --prefix=$INST_ROOT
 +
'''Note:''' if it complains about missing m4 directory do a
 +
mkdir m4
 
./autogen.sh --prefix=$INST_ROOT
 
./autogen.sh --prefix=$INST_ROOT
# if it complains about missing m4 directory do a
 
#mkdir m4
 
#./autogen.sh --prefix=$INST_ROOT
 
 
make install
 
make install
 
+
cd $SRC_ROOT/celt-0.5.1.3
12) cd $SRC_ROOT/celt-0.5.1.3
+
 
./configure --prefix=$INST_ROOT
 
./configure --prefix=$INST_ROOT
 
make install
 
make install
  
# only if you don't have a recent enough version of pixman (spice configure will complain if you need it)
+
'''Note:''' only if you don't have a recent enough version of pixman (spice configure will complain if you need it)
#cd $SRC_ROOT/pixman
+
cd $SRC_ROOT/pixman
#./autogen.sh --prefix=$INST_ROOT
+
./autogen.sh --prefix=$INST_ROOT
#make install
+
make install
 
+
Qemu, server and client
+
  
 
cd $SRC_ROOT/spice
 
cd $SRC_ROOT/spice
Line 42: Line 39:
 
./configure --prefix=$INST_ROOT --target-list=x86_64-softmmu --enable-spice
 
./configure --prefix=$INST_ROOT --target-list=x86_64-softmmu --enable-spice
 
make
 
make
 +
</source>
 +
 +
Next, follow the steps outlined in this guide => http://www.contrib.andrew.cmu.edu/~somlo/OSXKVM/
 +
 +
Remember to add <code>-vga qxl</code> to the QEMU command line argument to use the SPICE video driver.
 +
 +
The qemu command I'm using to get OS X to boot looks like the following,<br />
 +
 +
<source lang="bash">
 +
qemu-system-x86_64 -enable-kvm -m 4096 -cpu core2duo -machine q35 \
 +
-usb -device usb-kbd -device usb-mouse \
 +
-device isa-applesmc,osk="ourhardworkbythesewordsguardedpleasedontsteal(c)AppleComputerInc" \
 +
-kernel VM/chameleon_svn2400_boot -smbios type=2 -device ide-drive,bus=ide.2,drive=MacHDD \
 +
-drive id=MacHDD,if=none,file=VM/osx-mavericks.img \
 +
-netdev user,id=hub0port0 -device e1000-82545em,netdev=hub0port0,id=mac_vnet0 \
 +
-vga qxl
 +
</source>
 +
 +
After following these steps one should be able to boot OS X (10.9.5) using QEMU on a Linux based computer using the SPICE qxl video driver.
  
 
== See Also ==
 
== See Also ==
 
=== External Links ===
 
=== External Links ===
http://www.spice-space.org/page/Building_Instructions
+
http://www.spice-space.org/page/Building_Instructions<br />
http://wiki.qemu.org/Main_Page
+
http://wiki.qemu.org/Main_Page<br />
 +
http://www.contrib.andrew.cmu.edu/~somlo/OSXKVM/

Latest revision as of 11:39, 10 October 2014

In this tutorial / guide I hope to show one how to build QEMU with SPICE support, so one can use the qxl video driver when running a OS X under a QEMU Virtual Machine.

My current setup is the following, MBPr running archlinux with the most recent packages. (I run pacman -Syu probably once a week). However when I installed QEMU from AUR there wasn't support for SPICE at the time, so I decided to build QEMU from git source to include support for SPICE.

I chose to install the following packages in /opt/local to keep this separate from the archlinux packages.

mkdir /opt/local
mkdir /opt/src
cd /opt/src
git clone git://git.qemu-project.org/qemu.git
'''Note:''' QEMU is almost updated daily, so after cloning the repo to your local box, running git pull will get one updated to the latest greatest version of QEMU.
cd /opt/src
git clone git://cgit.freedesktop.org/spice/spice-protocol
git clone git://cgit.freedesktop.org/spice/spice
wget http://downloads.us.xiph.org/releases/celt/celt-0.5.1.3.tar.gz
tar xvzf celt-0.5.1.3.tar.gz
export PKG_CONFIG_PATH=$INST_ROOT/lib/pkgconfig:$INST_ROOT/share/pkgconfig
cd $SRC_ROOT/spice-protocol
./autogen.sh --prefix=$INST_ROOT
'''Note:''' if it complains about missing m4 directory do a
mkdir m4
./autogen.sh --prefix=$INST_ROOT
make install
cd $SRC_ROOT/celt-0.5.1.3
./configure --prefix=$INST_ROOT
make install
 
'''Note:''' only if you don't have a recent enough version of pixman (spice configure will complain if you need it)
cd $SRC_ROOT/pixman
./autogen.sh --prefix=$INST_ROOT
make install
 
cd $SRC_ROOT/spice
./autogen.sh --prefix=$INST_ROOT
make install
 
cd $SRC_ROOT/qemu
./configure --prefix=$INST_ROOT --target-list=x86_64-softmmu --enable-spice
make

Next, follow the steps outlined in this guide => http://www.contrib.andrew.cmu.edu/~somlo/OSXKVM/

Remember to add -vga qxl to the QEMU command line argument to use the SPICE video driver.

The qemu command I'm using to get OS X to boot looks like the following,

qemu-system-x86_64 -enable-kvm -m 4096 -cpu core2duo -machine q35 \
-usb -device usb-kbd -device usb-mouse \
-device isa-applesmc,osk="ourhardworkbythesewordsguardedpleasedontsteal(c)AppleComputerInc" \
-kernel VM/chameleon_svn2400_boot -smbios type=2 -device ide-drive,bus=ide.2,drive=MacHDD \ 
-drive id=MacHDD,if=none,file=VM/osx-mavericks.img \
-netdev user,id=hub0port0 -device e1000-82545em,netdev=hub0port0,id=mac_vnet0 \
-vga qxl

After following these steps one should be able to boot OS X (10.9.5) using QEMU on a Linux based computer using the SPICE qxl video driver.

See Also

External Links

http://www.spice-space.org/page/Building_Instructions
http://wiki.qemu.org/Main_Page
http://www.contrib.andrew.cmu.edu/~somlo/OSXKVM/