How to mount a new cdrom image with virsh and libvirt on kvm/qemu
You can’t.
This drove me crazy googling for an answer.
Most results suggested using virsh’s attach-disk command. Trouble is, attach-disk adds a whole new cdrom drive to the guest OS. After several uses our guest OS would have several cdrom drives, each with a once-needed iso mounted. Not exactly what we want.
Want to shut down your guest os, edit its xml file, then restart it every time you need to change disks? Neither do I.
No wait, you totally can!
libvirt is an abstraction on top of your virtual machine hypervisor. So libvirt doesn’t actually touch your guests. It just shuffles commands down to the real hypervisor. In my case it’s linux kvm/qemu. I wondered if kvm/qemu had a way to change cdrom disks.
Google says that changing the cd image in qemu requires issuing the eject and change commands. Awesome.
Now we need to pass a command down through libvirt into the nougaty kvm/qemu center. More reading provided me with virsh’s qemu-monitor-command which does just that. Use it like this:
virsh # qemu-monitor-command <domain> "<command>"
By the way—and this will jump up and bite you the first time you try it—but you will need to enclose the command in quotes so virsh passes it to qemu without complaint.
One final thing. We need a device name qemu understands. It’s not the same as you’d find in your libvirt xml files or /dev directory. You could probably figure it out, but it’s much easier to just ask qemu for a list of block devices (e.g. disk drives) like so:
virsh # qemu-monitor-command mirage "info block"
drive-virtio-disk0: type=hd removable=0 file=/home/daoist/mirage/mirage.qcow2 ro=0 drv=raw encrypted=0
drive-ide0-0-0: type=cdrom removable=1 locked=0 file=/home/daoist/iso/en_windows_7_ultimate_with_sp1_x64_dvd_u_677332.iso ro=1 drv=raw encrypted=0
drive-ide0-1-0: type=cdrom removable=1 locked=0 file=/home/daoist/iso/virtio-win-0.1-22.iso ro=1 drv=raw encrypted=0
See how there’s two cdrom drives in there? It’s because I tried the attach-disk technique. From this we can see that the device name we care about is drive-ide0-0-0. Tell qemu to eject the disk and then change to the new media:
virsh # qemu-monitor-command mirage "eject drive-ide0-0-0"
virsh # qemu-monitor-command mirage "change drive-ide0-0-0 /home/daoist/iso/en_office_professional_plus_2010_x86_x64_dvd_515529.iso"
virsh #
Your guest OS now has a new disk in its cdrom drive.
Android Basics: What is root?
Here’s an answer to a question I get asked often. For the super geeks in the crowd, try to remember that this is a high-level description. There’s lots of niggling details. For the geeks-in-training in the crowd, have fun with those niggling details.
Hey Keith, what is root? What does that mean to root my phone?
Android is based on Linux.
In Linux, like newer versions of Windows, accounts have different levels of access to the computer. The idea is that since most users don’t need to install software and change the hardware settings, they shouldn’t have access to do so accidentally.
In Windows, the account with the most access is called Administrator. In Linux, that account is called root. The root account can make vast and profound changes to the computer, to the point of crippling it. That’s why on Android you don’t get access to the root account.
By the way, your phone is just a tiny computer.
So, if you want to make big changes to your phone you need to get root access. The process of doing this is called rooting your phone. Generally this is done by exploiting a bug or problem in the Android operating system. This ranges from ridiculously easy to currently impossible depending on the phone you have. Newer phones and versions of Android fix these problems making it harder and harder to get root access to most phones.
Neat! But why would I want root? What can I do with it?
Most people who root their phones do so in order to install 3rd-party ROMs. A ROM, also called firmware, is essentially an operating system install file for your phone. Since Android is open-source software that means anyone can go get the original software, change it a bit, and then release it on their own. Lots of volunteers make improved versions of Android. Finding the right one for your phone is going to take some searching. But at least one popular bet is Cyanogenmod. Chances are there’s a Cyanogenmod ROM for your phone.
Some apps require root. Titanium Backup allows you to backup and restore your apps and data. This is very handy in case your phone dies or you install a new ROM (which will erase your phone). You can sometimes tweak the performance of your phone by increasing the CPU speed or changing memory settings. There are apps which allow free tethering, remote access to your phone, and more.
How do I get started?
Google it! But really, here’s a few links:
- http://forum.xda-developers.com/ — XDA Developers is a community centered around phone modification. They probably have a forum for your phone.
- http://wiki.rootzwiki.com/index.php/Main_Page — Rootzwiki has instructions for rooting lots of devices. There is also a forum there.
- http://www.cyanogenmod.com/ — If you don’t already have a ROM in mind, Cyanogenmod is a great one to try. It has lots of nice features.
There, that oughta shut the lit—err, hi. You’re still here? Why? Go play!
10.5.11Entourage Pocket Edge Google Apps & Market
Ermine + Market = Allmine
What this is:
- Installs Google Apps
- Fixes a problem with the Edgejr which prevents it from talking to google talk
- Allows all google apps to function properly
- Installs Superuser.apk & su (Version 3.0)
- Installs busybox
- Yes, you will have a working Market.
What this is not:
- A full ROM.
- An adb/titanium backup/root hack which involves copying apps from your phone.
Prerequisites:
- You must have a gapps zip file from http://wiki.cyanogenmod.com/wiki/Latest_Version
- You must have a microSD card.
- You must have a USB flashdrive.
- I have no idea if this will work if you have already tried installing google apps via other methods.
- I have no idea if this will work on the full sized Edge. If you want to send me an Edge to play with, that would be swell.
Instructions:
I have only tested this package from a stock Dingo (Android 1.6) ROM. If you want to try without downgrading all the way back to Dingo, let me know how it works. If you brick your edgejr, I’m sorry
If you want to wipe your PE and start from scratch, start with Downgrade to Dingo.
If you have the Stock firmware your PE shipped with and haven’t monkeyed with it at all, you can start with Upgrade to Ermine.
If you have upgraded to Ermine already and haven’t monkeyed with installing google apps via other methods, you can try to start with Install Allmine. If you have any problems, though, you will probably have to start over from the top.
Downgrade to Dingo
- I have made a version of the Dingo “Golden” update which skips some of the checks which stop the update from working. Get it here:http://bellybuttonporn.com/android/edgejr/Dingo-update.zip-hellbent.zipThis update will factory reset your PE! Do not proceed unless you have backed up all your data.
- Rename the zip file to “update.zip” and put it on the root of your USB flashdrive.
- Turn off your PE. Insert the flash drive.
- While holding Menu and Rotate on the LCD side, turn the PE on. Continue holding Menu and Rotate.
- The PE might reboot a few times before it actually updates. Once you see the Updating screen, you may let go of the Menu and Rotate buttons.The PE will reboot when the update is complete. When it boots up you will have the Dingo ROM. This is Android 1.6, and what it shipped with.
Upgrade to Ermine
- Download the Ermine ROM. Get it here:http://bellybuttonporn.com/android/edgejr/Ermine-update.zip
- Rename it to “update.zip” and put it in the root of your microSD card.
- Turn off your PE. Unplug your USB flashdrive and insert the microSD card.
- While holding Menu and Rotate on the LCD side, turn the PE on. Continue holding Menu and Rotate.
- The PE might reboot a few times before it actually updates. Once you see the Updating screen, you may let go of the Menu and Rotate buttons.The PE will reboot when the update is complete. When it boots up you will have the Ermine ROM. This is Android 2.2, released shortly before Entourage went belly-up.
Install Allmine
- Download Allmine. This update fixes a bug with the PE which prevents googletalk (and thus Market) from working. Get it here:http://bellybuttonporn.com/android/edgejr/Allmine-latest-update.zip
- Rename it to “update.zip” and put it in the root of your USB flashdrive.
- Download a Google Apps package from the Cyanogenmod wiki. Go here:http://wiki.cyanogenmod.com/wiki/Latest_VersionScroll to the bottom. You want the Cyanogenmod 6 HDPI zipfile.
- Rename it to “gapps.zip” and put it in the root of your USB flashdrive.Both Allmine (update.zip) and Google Apps (gapps.zip) need to be on your flash drive
- Turn off your PE. Unplug your microSD and insert the USB flashdrive.
- While holding Menu and Rotate on the LCD side, turn the PE on. Continue holding Menu and Rotate.
- The PE might reboot a few times before it actually updates. Once you see the Updating screen, you may let go of the Menu and Rotate buttons.The PE will reboot when the update is complete. When it boots up you will still have the Ermine ROM. Sorry!
But wait, there’s more. You’ll have Google apps, and they’ll work.When your PE restarts it will want you to complete the registration process. You will find that your on-screen keyboard is too wide so you probably can’t sign in to your google account. Whoops!
Setup Gingerbread Keyboard (optional)
- During the setup wizard, choose to sign in later.
- From your home screen, hit menu, then Language & Keyboard. Put a check next to “Gingerbread Keyboard”
- Hit back, go into “Accounts & Sync”. Tap Add account.
- Long-press on the input box for your email address. Choose Input method. Choose the gingerbread keyboard.
Setup
- Sign in to your google account.
- Go into your apps and into Market. Accept the User agreement.Watch about a zillion notifications popup that it’s updating your google apps to the latest versions.
Caveats & Things to Keep in Mind:
- The build.prop in your Pocket Edge is setup to fool Market into thinking it’s a Nexus One. The setup wizard also thinks it’s a Nexus One. As a result, you will only see market apps that will work on a Nexus One. Also, if you visit the market website your PE will be listed as Nexus One.
- You can try doing the various updates all from a USB flashdrive or from a microSD. I never had much luck. Dingo likes to upgrade via USB, ermine via microSD, and allmine via USB again. No idea why!
- A few people have tested this out. It seems to work fine. Proceed at your own risk. Let us know in this thread how it works.
- Keep holding the Menu & Rotate buttons until you see the update screen. Really.
- If your Allmine update fails for some reason, look in your USB flashdrive for an update.log file. Post that here.
- If you have tried some custom wackiness with your PE (perhaps you were hacking on it trying to get google apps to work?) and the upgrade(s) fail, your best bet is to start over with step 1 and wipe the PE.
- If your PE doesn’t respond during an upgrade for 30 minutes, you can turn it off by poking the reset button next to the USB port.
Library fix
su sqlite3 /intstorage/.edge/.esi-data/.databases/library.db "update esimeta set device='SERIAL_NUMBER_GOES_HERE'"
Have you moved your Library to your SDcard? (Thanks to bobthesane of mobileread.com forums for this fix)
su sqlite3 /sdcard/.edge/.esi-data/.databases/library.db "update esimeta set device='SERIAL_NUMBER_GOES_HERE'"
Version History
- 0.1.0 – Initial Release
- 0.1.1 – Fixed Library “could not insert” bug.
- 0.2.0 – Fixed trackpad, camera, and keyboard bug, big thanks to tarvoke and vldmr from mobileread.com forums for the build.prop edit. Added superuser.apk & su v3.0
Download links:
http://bellybuttonporn.com/android/edgejr/Dingo-update.zip-hellbent.zip
http://bellybuttonporn.com/android/edgejr/Ermine-update.zip
http://bellybuttonporn.com/android/edgejr/Allmine-latest-update.zip
http://wiki.cyanogenmod.com/wiki/Latest_Version
09.20.11
Playing with the Entourage Pocket Edge
I got in on the $80 woot deal for an Entourage Pocket Edge. I was interested in its big brother (the Edge) when it was released but balked at the price. So did everyone else. Now that the company’s defunct I got this for a song.
There is a little bit of a community for the device. Check here:
- Mirror of the maker’s help forum http://somestupidwebsite.com/download/edgeforums/edge-forums/www.entourageedge.com/forums/
- Extant hacking community: http://www.mobileread.com/forums/forumdisplay.php?f=218
- XDA-Devs: http://forum.xda-developers.com/showthread.php?t=1057206 (do more searching)
- OEM ROM downloads: http://dustyfeet.com/edge/
- Download the pocket edge ermine zip file from one of the above links.
- Rename it to update.zip
- Copy it to a microSD card or USB flash drive. Insert it into the pocket edge.
- With the PE off, hold down the MENU and ROTATE buttons on the LCD side.
- With your other hand, hit the power slider.
- HOLD the menu and rotate buttons for quite a while. Really.
- When the “Updating Software…” screen comes up, you can release the buttons.
Add your Youtube Subscriptions to Google Reader
You may have looked up this very question elsewhere and were provided with the following URL to paste in to Google Reader:
http://gdata.youtube.com/feeds/base/users/my_youtube_username/newsubscriptionvideos
Trouble is, that doesn’t work. Google reader can’t seem to understand the feed. Google News users report the same issue. I bet my solution will work for them too.
There are a zillion blog posts and forum threads out there about this, so here’s the answer.
Open up a text editor like notepad and paste this in:
<?xml version="1.0" encoding="UTF-8"?>
<opml version="1.0">
<head>
<title>My subscriptions in Google Reader</title>
</head>
<body>
<outline text="New Subscription Videos for Me"
title="New Subscription Videos for Me" type="rss"
xmlUrl="http://gdata.youtube.com/feeds/base/users/my_youtube_username/newsubscriptionvideos" htmlUrl="http://www.youtube.com/"/>
</body>
</opml>
Okay, now go back in and find “my_youtube_username” and replace that with your actual username. Save the file as whatever you want.
Open up google reader and go into the settings (currently available via the gray gear in the upper-right corner). Go into Import/Export, then choose the file you just saved. Once back on your Google Reader main page, you’ll see your subscription feed available with the rest.
Titanium Backup and CyanogenMod7: Got a problem?
I’ve run into this and from my searching it seems a few others have too.
Here’s the scenario: You’re running CyanogenMod 7 on your phone and you decide to try out a different ROM. You use Titanium Backup to save all your apps and data only to find that once you’re on the new ROM a lot of data doesn’t seem to stick around. Titanium reports that it’s successfully restored the data — and some of it really has been restored — but lots of data is missing. It’s restored to the default value from when you first installed the app.
Now here’s what’s really going on.
Titanium is indeed restoring your data. It just makes sure the app isn’t running and copies all of the database and prefs setting files into its data directory. No magic. That’s all it does and that’s all it needs to do. When your app starts up (if it’s coded well) it will check the integrity of its database files. If they are corrupt it will probably delete them and start over from scratch. Not exactly optimal, but at least the app can still run, right? Well that’s what’s happening here. Your app thinks its database file is corrupt.
CyanogenMod 7 uses a newer version of sqlite than other ROMs. (sqlite is the database engine underpinning android’s apps). This version introduces a new journaling method, the write-ahead-log, abbreviated wal for short. There’s a variety of technical benefits to using wal but that discussion doesn’t really impact our issue. Our issue is that the older version of sqlite on other ROMs doesn’t understand wal, so thinks your databases are corrupt. Bam, bye-bye data!
You can attempt this fix in one of two places. You can either fix the database files before you back them up, or after you restore them. In terms of having the right version of sqlite3 available, it’s probably best to try this before you back up your apps.
This fix assumes a few things. First, you have root. If you’re messing with CM7 and Titanium Backup you already have root. Not a problem. Second, you have busybox installed. Again, not a problem since Titanium requires busybox (and even installs it for you). Third, you have to have a sqlite3 binary somewhere on your phone. If your ROM doesn’t (some don’t for some reason) include it, you’re not screwed. I *think* Titanium will detect this and copy a binary to your phone when you click the “Problems?” button. If that’s not the case, there may be other copies of sqlite3 on your phone you can use. Open up a terminal, buddy, you’re goin in.
Find an sqlite3 binary:
find / -name sqlite3
This will locate sqlite3 for you, if it’s on your phone. Once you find it, (mine was in /system/xbin/, i.e. preinstalled in the ROM), make sure it’s new enough to understand wal.
/path/to/sqlite3 --version
If you get something 3.7.0 or higher, you’re in luck. If not, hopefully you found other sqlite3′s you can try. This is why it’s a good idea to do this BEFORE backing your apps up and flashing a new ROM. If your ROM has wal, its copy of sqlite3 does too.
I hesitate to call this a script, so here’s the command to run:
find /data/data/ -regex '.*databases/[^-]*' -exec /path/to/sqlite3 {} 'PRAGMA journal_mode=delete;' \;
Again, run this in a terminal. And yes, you do need to be root. What this is doing is going through all of the database files stored by your apps and setting them to the old journal_mode. You will get errors that certain files ending in -wal or -shm don’t exist. Don’t worry about those. When sqlite3 changes the journal_mode back to delete it will get rid of the -wal and -shm files automatically; that confuses find but doesn’t hurt anything. If an app is running during the process we won’t be able to open and update its database files. So make sure to kill them all from the Applications menu (or your task killer if you still have one of those around).
IMHO the best time to do this is on your old ROM (e.g. CM7) before doing the Titanium Backup. If you’ve already flashed to the new ROM and you’re stuck, then you can try running the command immediately after restoring everything in Titanium Backup. If you mess something up try not to panic; Titanium still has your data safely backed up. You can try again.
Leave a comment to tell everyone if this worked for you.
05.2.11Keep your chin up
I haven’t mentioned this before because I was embarrassed.
But it’s time to come clean.
Here’s what my car looks like now. Pretty good, eh? Thanks to Scotty’s Body Shop I’m all good to go. They did a great job and did it quickly. Their office manager, Curtis, even went above and beyond by ordering my bumper cover early just so I’d have it done quickly. I really appreciate it.
Contrary to my previous tweet, I suppose I will post a before picture.
Note the giant cracks in the bottom.
The first time my car got fixed by Shaffer’s in Ames they did a real shit job of it. The bottom was wavy and droopy so it’d get caught on curbs and parking stops all the time. Eventually it got bad enough that the underside would pull out when I backed up, causing the huge cracks. To add to the fun, State Farm left me twisting in the wind in terms of paying another deductible to re-fix the problem.
Enter Scotty’s Body Shop. They came highly recommended according to my best friend, Google. So I went in for a free estimate. From the very start their employees were eager to make sure I was well taken-care of. They explained the process of dealing with State Farm, how they were going to order parts, and even how they were going to have to have the damage reassessed. I’m pretty particular about my car and I really appreciated the attention paid to make sure I understood everything. That’s not to say they treated me like a dumbass; they were all respectful and seemed to be honestly pleased to help me.
I really have no frame of reference for this level of service. I don’t ever want to get into a car accident or have anything go wrong with my car again. But if it does happen, I won’t waste a second deciding where to go.
12.11.10…Through Chemistry
I am on drugs.
The problem with personal problems is that they’re so goddamned personal. Some problems you assume you’re the only person suffering so you’re embarrassed to ask for help. Does all the snot run to one side of your head and plug up only one of your nostrils when you lay on your side? Yeah it does for everyone, bub. Some problems you think are just normal so you don’t even contemplate getting help. Mine fall into the latter category.
12.6.10I’m raising awareness of the growing problem of Slacktivism
Slacktivism is the act of pretending to help a cause by signing an online petition, changing your facebook picture, going to a vigil, or anything else that looks like you’re helping but you actually aren’t.
Why do people do it? Well either they think they’re actually helping or they think they’re raising awareness. Let’s tackle the awareness-raising first.
Raising awareness is meaningless if everyone already knows about the problem. E.g. you can’t raise awareness about child abuse, AIDS, or world hunger because by now nearly everyone knows about those problems. Heart disease in women? You can raise awareness about that because people don’t really associate heart disease with women. See?
Secondly, what are you raising awareness of? If you’re just changing your facebook picture without some sort of call to action, you’re not doing what you think you’re doing. You’re raising awareness of…changing your picture on facebook.
BAD EXAMPLE:
“I changed my picture on facebook to help end child abuse!”
GOOD EXAMPLE:
“I changed my picture on facebook to raise awareness of the problem of child abuse. You can help fight by donating to (INSERT CHARITY HERE) and changing your picture too.”
See the difference?
As for actually helping, there’s plenty you could do. You could donate to a charity. You could volunteer some of your time. Or you could don spandex tights and a cape and swoop in through windows and beat up parents who are about to beat their kids. Eh better stick to the first two. In any case, merely changing your facebook picture isn’t helping anything.
The overall idea here is to consider the ramifications of your actions. Changing your facebook picture alone isn’t going to help anyone. To really help you have to donate your time or money. You have to actually do something.
With that in mind, I’m launching a facebook campaign to bright light to this horror of modern age. Just do what this says:
I changed my facebook picture to raise awareness of Slacktivism. You can help too by changing your facebook picture to whatever you want and posting this message on your wall. http://tinyurl.com/endslacktivism
Use Manual Settings for Testing your Android App
Here’s a quick tip for an issue I see asked all the time.
If you’re developing an android application and want to try it on your phone but you’ve been running it in an emulator (or vice versa) it’s a head-scratcher on how to get the app to be sent to your phone instead of the emulator you have running.
When you click the run button eclipse automatically figures out which emulator or device to run your app on. If you’ve got a few running emulators and/or devices plugged in, it just picks one. Probably the first. You want eclipse to ask you instead of guessing.
- Click the down arrow next to the run button. Then click on “Run Configurations…”

- Click on the Target tab.

- Click Manual.

- Finally, hit Apply then Close to save your changes.
Once you’ve done that eclipse will ask you which device you want to run your app on when you hit the run button. Sure, it adds another click to the process, but it allows you to have multiple emulators up or devices plugged in without confusion.



