MOVING!!!

Hey there, after several years of playing with Blogger and trying to get thing sorted out how I wanted, I finally decided to host my own domain so I could manage things easier. So this blog (which, admittedly, hasn't been updated much) is getting moved to my all-new site: DavisTobias.com/Linux. Also, to make it easier to transfer RSS feeds, this is the link to the new RSS feed. I'll leave this site and it's posts up, so I don't contribute to dead links on the internet, but I'm shutting off comments and won't post any more here.
Showing posts with label ubuntu. Show all posts
Showing posts with label ubuntu. Show all posts

November 28, 2009

Showing the list of installed packages

Hey there, this site has moved, so comments are disabled. Thankfully, you can go to the page, carefully linked for your satisfaction. Click here to go there.

I haven't had much time to play around in Linux for a while, what with school, but I recently got a new desktop computer and installed Windows 7 (the horror!) and am now doing some development using VirtualBox, the computer virtualization software. My desktop has all the power I will need for some time, but I would like a light-weight version of Ubuntu (my favored flavor) to install on my newly acquired Asus EEE PC 900A.

Later on I will post some of my findings, but for now I just wanted to point out the helpful command which will list all the packages currently installed: dpkg --get-selection

A word on the commands:
dpkg This is the debian package manager
--get-selection This is the command to list the installed packages

Another trick:
dpkg -L package This will list all the files associated with the package
dpkg --get-selection | grep package The "grep" command will search through the lengthy list and display anything with "package" in it's name.

This handy command will list every package currently installed, which is super helpful once you've generated your custom blend of software but haven't written down what you installed. Which I obviously did. Many times.

Of course, this list turns out to be a bit lengthy and unwieldy, especially since it outputs the list right in the terminal. Thankfully you can make the list go into a text file by using the command: dpkg --get-selection > filename.txt

The carat symbol, >, will take whatever would have gone to the terminal display, and output it to a file, "filename.txt".

April 17, 2009

Running loops with Qemu

Hey there, this site has moved, so comments are disabled. Thankfully, you can go to the page, carefully linked for your satisfaction. Click here to go there.

And now, for something completely different:


I am using Qemu to boot Ubuntu, from a different partition, inside of Ubuntu. Is this wise? Some suggest it is not, but I like to live on the wild side!

So the relevant code is pretty simple. Recall the last post on initializing Qemu, and take that, flip it around a bit, and here we go:

JUST REMEMBER YOU MAY BE DESTROYING YOUR DRIVE!!!!!

Sorry for that, here we go:
sudo qemu -m 768 -boot c -hda /dev/sda

The sudo bit is used here because apparently it's dangerous to mount the drive you are running. Pfff! The rest is:
qemu: The virtualizing program you are running
-m 768: You can tell Qemu how much memory to set aside. This is megabytes...
-boot c: It will boot from the virtual primary drive, instead of the cd-rom see?
-hda /dev/sda: The primary drive is /dev/sda, which is the drive I am running now

Note:
The command to restart the windows manager in Linux is control+alt+backspace. When you boot Qemu to another Linux and want to kill the windows manager, you can't use that because you will kill the main system you are using... Woops.

Now let me try to restart my extra Ubuntu, it took over five minutes last time...

Meanwhile, let me bore you with a story: I installed a second version of Ubuntu on an extra partition a while back. Thought maybe I could mess around with it and trim it down to nothing. Well, it worked but now I don't have any kind of anything on it. Good thing it was a spare. Okay it's back.

I mean, I messed it up bad. All it has is this:


Anyway, I won't bore you with the rest of the details, I was just noting that you could indeed boot Linux inside of Linux. I think I could even install Qemu on this virtual drive, boot the hard drive, and start Windows... Hold on...

I had to install a window manager, and I didn't want Gnome, so I picked FluxBox. It's the same window manager used in my favorite light-weight-heavy-hitter, DSL. Here I am, installing Qemu on my pretend computer on my pretend drive:


Alright, it just finished. Now to try booting another computer inside it. Instead of trying to kill it with another Ubuntu running, I will boot to my DSL file. Heh heh. Here we go:


The "inner world" Qemu is not handling the graphics very well, I can't even read the text on the screen:


Well, that didn't work very well at all. I don't think I have enough memory to really make this work. DSL finally booted after maybe 15 minutes, but it couldn't hardly load the window manager: It started and stalled, after 5 minutes I shut it down...

Well, anyway, that was fun.

April 16, 2009

Guess what I am doing?

Hey there, this site has moved, so comments are disabled. Thankfully, you can go to the page, carefully linked for your satisfaction. Click here to go there.


After I completely torched my previous Windows install with a virus infected software, I decided to try another way and install Windows in a virtual computer on Ubuntu!

Here is what I did, although some more differenter instructions can be found here:

Go to the famous "Add/Remove..." and install "Qemulator". I don't know how well suited this will be for my purposes, but this is a test anyway, so no big deal.

Now we need a fake hard drive. Now, go to the beautiful terminal (I made a keyboard shortcut: ctrl+alt+t) and travel to somewhere convenient and make a drive with Qemu:
qemu-img create windows.img 10000M

qemu-image: The Qemu program which makes the fake drive
create: I wonder if there is a detroy function?
windows.img: This is the file, which is a hard drive image
10000M: This is 10 Gigs, I am going to install a large program on here, so...

Now lets boot the fake machine up!
qemu -boot d -cdrom /dev/scd0 -hda windows.img

qemu: The program virtualizing an entire computer!
-boot d: This tells qemu what drive to pretend to boot from, in this case the cd
-cdrom /dev/scd0: The cdrom is this device, make sure it's your actual cd*
-hda windows.img: This is the earlier created hard drive image

Now Qemu will boot up to whatever cd you previously mounted on your computer. What? You didn't mount the disk yet? Well, do that, type the above command, and come back here.

Okay, now Qemu should boot up into whatever the cd was, in my case it was the Windows XP installation guide. The setup was all plain-text, fine with me, and took maybe 8 minutes. Then Windows wants to restart. It will restart Qemu, but exit the program first.

What you need to do is start Qemu back up, this time with only slightly different commands:
qemu -boot c -cdrom /dev/scd0 -hda windows.img

These are the same as last time, except for this one:
-boot c: This tells Qemu to boot to what Windows wants to call the C:/ drive, which is your "windows.img" fake hard drive file.

Now Windows should boot into it's familiar black screen with that awesome graphic window-esque thing, and then it will want to install all the drivers, files, etc., just like a normal Windows installation.

It seems that, to get the internets to work inside Qemu, you have to tell it to pass network capabilities through. It virtualizes everything else, network and usb support as well. To do that, add -net nic to the end of the command, so it looks like:
qemu -boot c -cdrom /dev/scd0 -hda windows.img -net nic

Other instructions said use -net user, I don't know the difference very well, but -net nic was the only one that worked for me.

Once you are comfortable with your Qemu configurations, you probably want to make a shortcut of some kind so you don't have to remember this command all the time. I don't have any cool tricks up my sleeve on this one, just copy and paste the command into a hand-made shortcut.

One more thing: I installed Qemu by using the "Add/Remove..." in Ubuntu, but I found the GUI was not useful, and had enough interface glitches that running through the command line is much easier. If I can figure out the command line way to install I will let you know, it's probably really simple.


*To double check your cd drive, go to the terminal (after you put in your cd and can open it's folders) and type:
df
This will list all the mounted things, drives and memory are both "mounted" in Linux, look for one that says "/dev/scd0" or perhaps "/dev/cdrom", but on the right it will have the title of the cd, like "/media/X1APFPP_EN" or something similarly unintelligible.