<?xml version='1.0' encoding='utf-8' ?>
<!--  If you are running a bot please visit this policy page outlining rules you must respect. http://www.livejournal.com/bots/  -->
<rss version='2.0' xmlns:lj='http://www.livejournal.org/rss/lj/1.0/' xmlns:media='http://search.yahoo.com/mrss/' xmlns:atom10='http://www.w3.org/2005/Atom'>
<channel>
  <title>So I don&apos;t have to remember...</title>
  <link>http://rholcombe.livejournal.com/</link>
  <description>So I don&apos;t have to remember... - LiveJournal.com</description>
  <lastBuildDate>Thu, 22 Dec 2005 17:08:19 GMT</lastBuildDate>
  <generator>LiveJournal / LiveJournal.com</generator>
  <lj:journal>rholcombe</lj:journal>
  <lj:journalid>8861222</lj:journalid>
  <lj:journaltype>personal</lj:journaltype>
  <atom10:link rel='hub' href='http://pubsubhubbub.appspot.com/' />
<item>
  <guid isPermaLink='true'>http://rholcombe.livejournal.com/955.html</guid>
  <pubDate>Thu, 22 Dec 2005 17:08:19 GMT</pubDate>
  <title>Xen</title>
  <link>http://rholcombe.livejournal.com/955.html</link>
  <description>Been trying to figure out Xen and get it running reliably.&lt;br /&gt;&lt;br /&gt;So far....&lt;br /&gt;&lt;br /&gt;Also this is using the binary files for Xen, once I have a spare box free I&apos;ll modify this to include patching the kernel so you don&apos;t have to reboot into a Xen kerenl.&lt;br /&gt;&lt;br /&gt;Decide where the images will live. (/opt /home /var, whatever)&lt;br /&gt;&lt;br /&gt;mkdir -p /opt/xen/bin&lt;br /&gt;&lt;br /&gt;cd /opt/xen/bin&lt;br /&gt;&lt;br /&gt;wget &lt;a href=&quot;http://bits.xensource.com/Xen/latest/xen-3.0.0-install-x86_32.tgz&quot;&gt;http://bits.xensource.com/Xen/latest/xen-3.0.0-install-x86_32.tgz&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;untar the file&lt;br /&gt;&lt;br /&gt;./install.sh&lt;br /&gt;&lt;br /&gt;update-rc.d xend defaults&lt;br /&gt;&lt;br /&gt;update-rc.d xendomains defaults&lt;br /&gt;&lt;br /&gt;mv /lib/tls /lib/tls.disabled &amp;lt;-- trying to find a way around this, maybe it&apos;s a waste of time though...&lt;br /&gt;&lt;br /&gt;add to /boot/grub/menu.lst&lt;br /&gt;&lt;br /&gt;title Xen 3.0 / XenLinux 2.6&lt;br /&gt;kernel /boot/xen-3.0.gz dom0_mem=262144&lt;br /&gt;module /boot/vmlinuz-2.6-xen0 root=/dev/hda1 ro console=tty0&lt;br /&gt;&lt;br /&gt;apt-get install bridge-utils iproute debootstrap&lt;br /&gt;&lt;br /&gt;mkdir -p /opt/xen/domains/vm01&lt;br /&gt; dd if=/dev/zero of=/opt/xen/domains/vm01/diskimage bs=1024k count=1024 (count=1024 assumes 1 GB drive, adjust accordingly)&lt;br /&gt; dd if=/dev/zero of=/opt/xen/domains/vm01/swapimage bs=1024k count=128  (128 MB swap adjust accordingly)&lt;br /&gt; mkfs.ext3 /opt/xen/domains/vm01/diskimage&lt;br /&gt; mkswap /opt/xen/domains/vm01/swapimage&lt;br /&gt; mkdir /mnt/disk&lt;br /&gt; mount -o loop /opt/xen/domains/vm01/diskimage /mnt/disk&lt;br /&gt; debootstrap --arch i386 sarge /mnt/disk &lt;a href=&quot;http://ftp.us.debian.org/debian&quot;&gt;http://ftp.us.debian.org/debian&lt;/a&gt;&lt;br /&gt; chroot /mnt/disk /bin/bash&lt;br /&gt; cd /etc; vi hostname hosts resolv.conf&lt;br /&gt;&lt;br /&gt;create fstab &lt;br /&gt; /dev/sda1     /     ext3     errors=remount-ro     0     1&lt;br /&gt; /dev/sda2     none  swap     sw                    0     0&lt;br /&gt; proc          /proc proc     defaults              0     0&lt;br /&gt;&lt;br /&gt;logout and umount&lt;br /&gt;&lt;br /&gt;configure Xen machine&lt;br /&gt; cat &amp;gt; /etc/xen/vm01.cfg&lt;br /&gt; kernel = &quot;/boot/vmlinuz-2.6.12.6-xenU&quot;&lt;br /&gt; memory = 96&lt;br /&gt; name = &quot;vm01&quot;&lt;br /&gt; dhcp = &quot;dhcp&quot;&lt;br /&gt; disk = [ &apos;file:/opt/xen/domains/vm01/diskimage,sda1,w&apos;,&apos;file:/opt/xen/domains/vm01/swapimage,sda2,w&apos; ]&lt;br /&gt; root = &quot;/dev/sda1 ro&quot;&lt;br /&gt;&lt;br /&gt;start the Xen machine&lt;br /&gt;xm create vm01 -c (-c connects a console, if omitted use xm console vm01)&lt;br /&gt;&lt;br /&gt;login as root (no password set yet)&lt;br /&gt;&lt;br /&gt;passwd&lt;br /&gt;apt-setup or base-config&lt;br /&gt;apt-get update &amp;&amp; apt-get upgrade&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;This is not the easiest, or even best way to do this but I&apos;ve only been looking at it for about 2 hours and this is what I have so far.&lt;br /&gt;&lt;br /&gt;UPDATE&lt;br /&gt;disk = [ &apos;phy:/dev/hdX,hda1,w&apos;, &apos;phy:/dev/hdY,hda2,w&apos; ] &amp;lt;-- partitions instead of files guess LVM would run in a similiar manner&lt;br /&gt;&lt;br /&gt;REFERENCES&lt;br /&gt;&lt;br /&gt;&lt;a href=&quot;http://julien.danjou.info/xen.html&quot;&gt;http://julien.danjou.info/xen.html&lt;/a&gt;</description>
  <comments>http://rholcombe.livejournal.com/955.html</comments>
  <lj:security>public</lj:security>
  <lj:reply-count>0</lj:reply-count>
</item>
<item>
  <guid isPermaLink='true'>http://rholcombe.livejournal.com/540.html</guid>
  <pubDate>Sun, 11 Dec 2005 04:34:24 GMT</pubDate>
  <title>Projects</title>
  <link>http://rholcombe.livejournal.com/540.html</link>
  <description>Upcoming projects...&lt;br /&gt;&lt;br /&gt;Terminal Server&lt;br /&gt;&lt;br /&gt;Dansguardian &amp; ClamAV (Content filtering and AV)&lt;br /&gt;&lt;br /&gt;Reconfigure network services and organization (SSL CA, etc...)&lt;br /&gt;&lt;br /&gt;Jabber Server&lt;br /&gt;&lt;br /&gt;COMPLETED&lt;br /&gt;&lt;br /&gt;Unslung; got XBMC media shares off samba and on to XBMSP (granted wide open udp is probably more of a security risk than weak passworded samba but it is all internal and if someone really wants to steal/delete my movies/mp3&apos;s that bad they can... might look at removing samba from the nslu2&lt;br /&gt;wireless running openwrt w/multiple bridges&lt;br /&gt;Like WiKID but the open version does not support J2ME clients so using my cell phone as a fob won&apos;t work, might be worth setting up the commercial trial iso on a VM but I&apos;ll come back to this later</description>
  <comments>http://rholcombe.livejournal.com/540.html</comments>
  <lj:security>public</lj:security>
  <lj:reply-count>0</lj:reply-count>
</item>
<item>
  <guid isPermaLink='true'>http://rholcombe.livejournal.com/319.html</guid>
  <pubDate>Mon, 28 Nov 2005 03:05:35 GMT</pubDate>
  <title>Qemu with kernel acceleration</title>
  <link>http://rholcombe.livejournal.com/319.html</link>
  <description>Basic directions for installing qemu with kernel acceleration and bridged networking. For image space I recommend an LVM configuration. (The steps for checkinstall are somewhat optional. I&apos;ve had mixed results using this.)&lt;br /&gt;&lt;br /&gt;Go to &lt;a href=&quot;http://fabrice.bellard.free.fr/qemu/download.html&quot;&gt;http://fabrice.bellard.free.fr/qemu/download.html&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Download qemu source (At the time of writing I used qemu-0.7.2.tar.gz)&lt;br /&gt;Download kqemu binary (At the time of writing I used kqemu-0.7.2.tar.gz)&lt;br /&gt;&lt;br /&gt;Install your kernel headers.&lt;br /&gt;sudo apt-get install linux-headers-$(uname -r)&lt;br /&gt;&lt;br /&gt;Install building packages&lt;br /&gt;sudo apt-get install libsdl1.2-dev&lt;br /&gt;sudo apt-get install zlib1g-dev&lt;br /&gt;sudo apt-get install checkinstall&lt;br /&gt;sudo apt-get build-dep qemu&lt;br /&gt;&lt;br /&gt;Extract qemu and kqemu&lt;br /&gt;&lt;br /&gt;Make sure you substitute the x for your version number.&lt;br /&gt;cd $HOME/src&lt;br /&gt;tar zxvf qemu-0.7.x.tar.gz&lt;br /&gt;cd qemu-0.7.x&lt;br /&gt;tar zxvf ../kqemu-0.7.x.tar.gz&lt;br /&gt;sudo ln -s /usr/src/linux-headers-$(uname -r) /usr/src/linux-headers&lt;br /&gt;cd qemu-0.7.x&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Edit the configure file&lt;br /&gt;&lt;br /&gt;vi configure&lt;br /&gt;&lt;br /&gt;change this line:&lt;br /&gt;&lt;br /&gt;kernel_path=&quot;&quot;&lt;br /&gt;&lt;br /&gt;To this&lt;br /&gt;&lt;br /&gt;kernel_path=&quot;/usr/src/linux-headers&quot;&lt;br /&gt;&lt;br /&gt;After you save and quit, run:&lt;br /&gt;./configure&lt;br /&gt;&lt;br /&gt;You should see something similar to the following:&lt;br /&gt;&lt;br /&gt;harrisj@brightstar:~/src/qemu-0.7.2$ ./configure&lt;br /&gt;Install prefix /usr/local&lt;br /&gt;BIOS directory /usr/local/share/qemu&lt;br /&gt;binary directory /usr/local/bin&lt;br /&gt;Manual directory /usr/local/share/man&lt;br /&gt;ELF interp prefix /usr/gnemul/qemu-%M&lt;br /&gt;Source path /home/harrisj/src/qemu-0.7.2&lt;br /&gt;C compiler gcc&lt;br /&gt;Host C compiler gcc&lt;br /&gt;make make&lt;br /&gt;host CPU i386&lt;br /&gt;host big endian no&lt;br /&gt;target list i386-user arm-user armeb-user sparc-user ppc-user i386-softmmu ppc-softmmu sparc-softmmu x86_64-softmmu mips-softmmu&lt;br /&gt;gprof enabled no&lt;br /&gt;static build no&lt;br /&gt;SDL support yes&lt;br /&gt;SDL static link yes&lt;br /&gt;mingw32 support no&lt;br /&gt;Adlib support no&lt;br /&gt;FMOD support no&lt;br /&gt;kqemu support yes&lt;br /&gt;&lt;br /&gt;KQEMU Linux module configuration:&lt;br /&gt;kernel sources /usr/src/linux-headers&lt;br /&gt;kbuild type 2.6&lt;br /&gt;harrisj@brightstar:~/src/qemu-0.7.2$&lt;br /&gt;&lt;br /&gt;If everything has gone as planned, you should have yes next to kqemu.&lt;br /&gt;&lt;br /&gt;Now type&lt;br /&gt;&lt;br /&gt;make&lt;br /&gt;&lt;br /&gt;When you install a package from source there is usually no way to uninstall that package. This can cause problems down the track when you want to upgrade a program, there is no way to uninstall the old package safely.&lt;br /&gt;&lt;br /&gt;This is where “checkinstall” steps in. Checkinstall creates a .deb package for you, which is easy to remove later.&lt;br /&gt;&lt;br /&gt;Create the deb package.&lt;br /&gt;&lt;br /&gt;sudo checkinstall -D&lt;br /&gt;&lt;br /&gt;At this point checkinstall will ask you some questions.&lt;br /&gt;&lt;br /&gt;1st question: Answer = default y&lt;br /&gt;2nd question: Answer = Any description you like about qemu&lt;br /&gt;&lt;br /&gt;You can safely leave the next menu alone and just press enter&lt;br /&gt;&lt;br /&gt;Next, checkinstall will build the .deb package and install it. For me and other checkinstall reports that it fails and asks if you want to view the output.&lt;br /&gt;&lt;br /&gt;Do not worry about this. Qemu did install successfully.&lt;br /&gt;&lt;br /&gt;sudo vi /etc/modules&lt;br /&gt;&lt;br /&gt;Add to the bottom:&lt;br /&gt;kqemu&lt;br /&gt;tun&lt;br /&gt;&lt;br /&gt;Load them manually for now:&lt;br /&gt;sudo modprobe kqemu&lt;br /&gt;sudo modprobe tun&lt;br /&gt;&lt;br /&gt;This section is the hardest section but it brings great rewards. If you want the virtual machine to be accessible by any other computer on the network this section is necessary.&lt;br /&gt;&lt;br /&gt;Other wise you can use “user mode” networking.&lt;br /&gt;&lt;br /&gt;Install bridge utilities and user mode utilities&lt;br /&gt;&lt;br /&gt;sudo apt-get install bridge&lt;br /&gt;sudo apt-get install uml-utilities&lt;br /&gt;&lt;br /&gt;A network bridge is a virtual network interface that contains one or more real/virtual interfaces. Basically what this does is:&lt;br /&gt;&lt;br /&gt;Create a bridge device&lt;br /&gt;Add our eth0 (or other LAN device) to the bridge.&lt;br /&gt;Modify security permissions to allow qemu to add a Virtual interface to the bridge.&lt;br /&gt;&lt;br /&gt;This will allow your virtual ip address of your virtual pc to have a real ip address on your internal LAN. Get it?&lt;br /&gt;&lt;br /&gt;*Note – During this section you will lose network connectivity.&lt;br /&gt;**Note – Please substitute eth0 for the name of your LAN interface.&lt;br /&gt;&lt;br /&gt;Create the bridge interface&lt;br /&gt;sudo brctl addbr br0&lt;br /&gt;Give the LAN interface a neutral IP&lt;br /&gt;sudo ifconfig eth0 0.0.0.0&lt;br /&gt;Add the LAN interface to the bridge&lt;br /&gt;sudo brctl addif br0 eth0&lt;br /&gt;&lt;br /&gt;Next we have to modify the file /etc/network/interfaces to allow your bridge to obtain an ip address automatically. For static IP, check further below.&lt;br /&gt;&lt;br /&gt;sudo vi /etc/network/interfaces&lt;br /&gt;&lt;br /&gt;For Dynamic IP&lt;br /&gt;&lt;br /&gt;# The primary network interface&lt;br /&gt;auto br0&lt;br /&gt;iface br0 inet dhcp&lt;br /&gt;bridge_ports eth0&lt;br /&gt;bridge_fd 1&lt;br /&gt;bridge_hello 1&lt;br /&gt;bridge_stp off&lt;br /&gt;&lt;br /&gt;Now its time to restart the Network and restore network connectivty.&lt;br /&gt;&lt;br /&gt;sudo /etc/init.d/hotplug restart&lt;br /&gt;sudo /etc/init.d/network restart&lt;br /&gt;&lt;br /&gt;To check if everything went well type ifconfig and check to see if the device br0 listed has an IP address.&lt;br /&gt;&lt;br /&gt;Eg&lt;br /&gt;&lt;br /&gt;br0 Link encap:Ethernet HWaddr 00:0C:6E:74:41:62&lt;br /&gt;inet addr:192.168.0.77 Bcast:192.168.0.255 Mask:255.255.255.0&lt;br /&gt;inet6 addr: fe80::20c:6eff:fe74:4162/64 Scope:Link&lt;br /&gt;UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1&lt;br /&gt;RX packets:3826802 errors:0 dropped:0 overruns:0 frame:0&lt;br /&gt;TX packets:3899124 errors:0 dropped:0 overruns:0 carrier:0&lt;br /&gt;collisions:0 txqueuelen:0&lt;br /&gt;RX bytes:2844083685 (2.6 GiB) TX bytes:3126628692 (2.9 GiB)&lt;br /&gt;&lt;br /&gt;Wow you just created a network bridge in linux Good Job!&lt;br /&gt;&lt;br /&gt;Now you have created a bridge and added your LAN interface, you can create the virtual interface for Qemu to use.&lt;br /&gt;&lt;br /&gt;Create the tun interface – Be sure to substitute “harrisj” for your username.&lt;br /&gt;&lt;br /&gt;sudo tunctl -u &apos;harrisj&apos; -t tun0&lt;br /&gt;sudo chgrp admin /dev/net/tun&lt;br /&gt;sudo chmod g+w /dev/net/tun&lt;br /&gt;&lt;br /&gt;sudo vi /etc/qemu-ifup&lt;br /&gt;&lt;br /&gt;Change the file to the following:&lt;br /&gt;#!/bin/sh&lt;br /&gt;echo &quot;Executing /etc/qemu-ifup&quot;&lt;br /&gt;echo &quot;Bringing up $1 for bridged mode...&quot;&lt;br /&gt;sudo /sbin/ifconfig $1 0.0.0.0 promisc up&lt;br /&gt;echo &quot;Adding $1 to br0...&quot;&lt;br /&gt;sudo /usr/sbin/brctl addif br0 $1&lt;br /&gt;sleep 2&lt;br /&gt;&lt;br /&gt;sudo chmod ug0+x /etc/qemu-if &lt;br /&gt;&lt;br /&gt;As a last bit the /dev/kqemu device may not survive a reboot, to fix this...&lt;br /&gt;vi /etc/init.d/bootmisc.sh&lt;br /&gt;&lt;br /&gt;At the bottom add:&lt;br /&gt;&lt;br /&gt;mknod /dev/kqemu c 250 0 &lt;br /&gt;chmod 666 /dev/kqemu&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;## TODO ##&lt;br /&gt;Add content about not running qemu in bridged mode, include basic natting instructions. (Test network setup)</description>
  <comments>http://rholcombe.livejournal.com/319.html</comments>
  <lj:security>public</lj:security>
  <lj:reply-count>0</lj:reply-count>
</item>
</channel>
</rss>
