<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.d3xt3r01.tk//index.php?action=history&amp;feed=atom&amp;title=Using_Qemu</id>
	<title>Using Qemu - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.d3xt3r01.tk//index.php?action=history&amp;feed=atom&amp;title=Using_Qemu"/>
	<link rel="alternate" type="text/html" href="https://wiki.d3xt3r01.tk//index.php?title=Using_Qemu&amp;action=history"/>
	<updated>2026-05-05T17:24:21Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.45.1</generator>
	<entry>
		<id>https://wiki.d3xt3r01.tk//index.php?title=Using_Qemu&amp;diff=3&amp;oldid=prev</id>
		<title>Admin: New page: ==About== Ok .. so my mind was buzzing to make mac os work in qemu .. doesn&#039;t work ! :P so don&#039;t bother .. here&#039;s what I did so far .. this should be usable at any other OS though ..  ==St...</title>
		<link rel="alternate" type="text/html" href="https://wiki.d3xt3r01.tk//index.php?title=Using_Qemu&amp;diff=3&amp;oldid=prev"/>
		<updated>2009-06-25T18:15:14Z</updated>

		<summary type="html">&lt;p&gt;New page: ==About== Ok .. so my mind was buzzing to make mac os work in qemu .. doesn&amp;#039;t work ! :P so don&amp;#039;t bother .. here&amp;#039;s what I did so far .. this should be usable at any other OS though ..  ==St...&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;==About==&lt;br /&gt;
Ok .. so my mind was buzzing to make mac os work in qemu .. doesn&amp;#039;t work ! :P so don&amp;#039;t bother .. here&amp;#039;s what I did so far .. this should be usable at any other OS though ..&lt;br /&gt;
&lt;br /&gt;
==Steps==&lt;br /&gt;
1) create a disk image ! ( that would replace the regular hdd )&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
qemu-img create -f qcow2 /media/win_d/Downloads/isos/mac.cow 2000M&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
this means create a qcow2 fs ( that would only take as much space as it needs .. it won&amp;#039;t create a 2GB file ! ) at mac.cow pwd .. max size 2000M !&lt;br /&gt;
&lt;br /&gt;
2)&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
qemu -hda /media/win_d/Downloads/isos/mac.cow -boot d -cdrom /media/win_d/Downloads/isos/file.iso -m 384 -localtime&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
which means to load hda in the file we created .. boot from cdrom .. the cdrom being the iso with 384 ram and use the local system time&lt;br /&gt;
now .. in linux if you don&amp;#039;t have enough space in /dev/shm .. you could use -no-kqemu to disable acceleration or do this:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
umount /dev/shm&lt;br /&gt;
mount -t tmpfs -o size=400m none /dev/shm&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
which would create a bigger shm partition ! :)&lt;br /&gt;
&lt;br /&gt;
3) &lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
qemu -hda /media/win_d/Downloads/isos/mac.cow -boot c -m 384 -localtime&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
which would tell qemu to boot from the virtual hdd we created :) this would be it &lt;br /&gt;
&lt;br /&gt;
qemu -h for other options !&lt;br /&gt;
&lt;br /&gt;
==Other info==&lt;br /&gt;
It would be nice of you to install kqemu - the qemu acceleration layer ... Also, if you&amp;#039;re on a console only .. use -nographic ... if you want a vnc add -vnc ip:1 ( to start a vnc on display 1 ) and don&amp;#039;t use -nographic ( it&amp;#039;ll lock ) ... Also if you want to .. you can use -daemonize to be able to reuse the console after it started .. &lt;br /&gt;
&lt;br /&gt;
==Networking==&lt;br /&gt;
If you want your box just to use the internet .. use dhclient inside it to access get the ip ( qemu will act as the dhcp server ) .. no other stuff is necesarry ...&lt;br /&gt;
&lt;br /&gt;
If not .. you need to do this as root&lt;br /&gt;
Be sure to chmod  +x /etc/qemu-ifup containing and add -net nic -net tap to qemu&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
/sbin/ifconfig $1 192.168.10.1 netmask 255.255.255.0 up&lt;br /&gt;
sleep 2&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Inside the guest do this:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ifconfig eth0 192.168.10.5 netmask 255.255.255.0&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
You should be able to ping one another .. don&amp;#039;t forget to this on the qemu host:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
echo 1 &amp;gt; /proc/sys/net/ipv4/ip_forward&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
and this in the host&amp;#039;s gateway&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
# allow 192.168.10.0 to come from 10.3.0.123 ( my qemu host ip ) via eth0 ( gw eth )&lt;br /&gt;
ip ro add 192.168.10.0/24 via 10.3.0.123 dev eth0&lt;br /&gt;
# make him exit to the internet with external_ip and whatever comes from the external_ip to go to qemu&lt;br /&gt;
iptables -t nat -A POSTROUTING -s 192.168.10.5 -j SNAT --to-source external_ip&lt;br /&gt;
iptables -t nat -A PREROUTING -d external_ip -j DNAT --to-destination 192.168.10.5&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Qemu needs to be ran as root in order to be able to access the tap ..&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Resizing the partition .... from the initial 2000M to 4G&lt;br /&gt;
&lt;br /&gt;
First step would be to convert the qcow2 disk image to raw format&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
qemu-img convert -f qcow2 mac.cow -O raw mac.raw&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Then resize the raw partition using dd .. it won&amp;#039;t harm the file contents .. ( 4096 means 4 G .. you can use 8192 and stuff .. )&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
dd if=/dev/zero of=mac.raw bs=1M count=0 seek=4096&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
And last ... convert it back to the qcow2 format so only used blocks would take up space ...&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
qemu-img convert -f raw mac.raw -O qcow2 newmac.cow&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
You can now verify&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
qemu-img info newmac.cow&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Links==&lt;br /&gt;
[http://www.claunia.com/qemu/ HomePage]&lt;br /&gt;
&lt;br /&gt;
==Results==&lt;br /&gt;
So ... you&amp;#039;d have a fully functional virtual machine with whatever settings you want .. hope it helped ..&lt;/div&gt;</summary>
		<author><name>Admin</name></author>
	</entry>
</feed>