Thursday, March 25, 2010

How-to (Part 2): Full read/write access to ReiserFS in Windows 7

A few years ago I did a good bit of hacking and wrote this article: How-to: Full read/write access to ReiserFS in Windows Server 2008 x64

This St. Patrick's day I was at a bar with a friend of mine from my old Community College days and we were discussion virtualization software.  Yes.  I am that nerdy.  I was bemoaning my usual complaint that VMWare Server 1.x, which I used in the original article since it supported raw disk access, takes an absurdly long time to start a VM on Windows Server 2008, and also Windows 7 (presumably Windows Vista as well).  This startup time is on the order of 6-8 minutes during which the entire system is hung and unusable.  He was curious why I didn't use something like VirtualBox.  I had been under the impression that VirtualBox didn't do this since it wasn't in the GUI or listed as a feature.  However, I was wrong.

My enlightened friend shared with me this manual page. So I finally had some options, it seemed.  It took a few hours of poking but I finally got everything working with VirtualBox and it is absolutely wonderful.

So here is how I did it on Windows 7:
  1. Install VirtualBox as normal.
  2. I copied the .vmdk files I'd used to set this up with VMWare.  If you don't have these files to copy then create a new VM in VirtualBox of the appropriate flavor of linux and do the installation as per the original article.
    1. You will need to support ReiserFS and Samba, make sure your setup includes these.
    2. Create the new .vmdk as per the linked page from the VirtualBox.  You can find the drive # by populating volume properties from the device manager.
  3. In order for the raw disk access to work under Windows 7 you will need to set the compatibility options on C:\Program Files\Sun\VirtualBox\VirtualBox.exe to run it as administrator.
  4. Link the new vmdk first to VirtualBox with the Virtual Media Manager, open the VMM and click "Add" to add the vmdk(s)
  5. Create a new virtual machine of the appropriate flavor of linux. If you copied files from a VMWare installation you will need to add a SATA bus to the VM's storage configuration and add the vmdk's to that controller.  If you installed from scratch in VirtualBox don't do this now, it will only complicate your life.
At this point you should have everything installed and be able to boot your VM, and share your files back to Windows.  The only problem with this is that VirtualBox is geared more to run as a consumer level virtualizer.  If you close the window the machine starts in, the machine will be forced to shut down.  This means that you would need to keep a window open, wasting space in your taskbar, just to access your files.  Fortunately, there's a way around that as well.

  1. Set the options on C:\Program Files\Sun\VirtualBox\VBoxHeadless.exe to run as administrator.
  2. Create a new text file on your desktop, name it "Start VM.vbs"
  3. In the file, paste:



    Set WshShell = CreateObject("WScript.Shell")
    WshShell.Run chr(34) & "C:\Program Files\Sun\VirtualBox\VBoxHeadless.exe" & chr(34) & " --startvm VBoxReiser", 0
    Set WshShell = Nothing
  4. Replace VBoxReiser with the name of the VM you created above
  5. Save this file
This is why you need to set VBoxHeadless to run as administrator.  You will be prompted to allow the program to run as admin, but then you will see no further windows.  Your VM will be running in the background without.  Since you've started this headlessly you will not be able to use the standard GUI to shut down the VM later, so you will need to create another VBS or BAT file, executing:
 
VBoxManage controlvm VMNAME acpipowerbutton

This will shut the VM down, assuming it is responding to ACPI signals.
    Any network configurations you had in VMWare should be relatively simple to set back up in VirtualBox.

    I've been running this for a few days now and it is so much better.  I no longer need to dread rebooting because of the horrifying start times from VMWare.  It was fun to do a nice bit of tech stuff out of work.

    --PXA

    Wednesday, March 10, 2010

    Perverting Common Wisdom (A stock market tale)

    "Perverting common wisdom, Nephew, is the mark of all great conspiracies" - Baron Vladimir Harkonnen (Dune, Frank Herbet)

    It's an accepted premise that to make money you need to spend money. And to spend money you need to have money. So by syllogism, to make money you need to have money. This applies to the stock market quite sensibly, and most people agree that you should start an investment account with $2,000 or else you simply won't be able to make the aggregate gains required to counter commission fees. Aggregate gains is very important, because it is really how you are to play the game correctly. Most stocks will not jump several hundred dollars, or for that matter several dozen dollars, in anything resembling a sensible period of time to hold a stock. Not without some major news coming out of that company.  So you're looking to make a few cents to a few bucks on hundreds of shares.

    But what if you don't have this $2,000 to invest, is it still possible to make money? With, say, $700? If you are careful, subtle, and lucky can you make not-enough into enough?
    To this end I'm starting a new blogspot site:  A Stock Market Tale
    Hello, Readers. I'd like to play a game.

    First, my rules:
    • I can only use my initial investment of $700, and any money earned from this initial investment
    • As I only have $700 and want to make the absolute most of it, I cannot pay for any service beyond my broker.  Everything I use for my research will have to be free.  No trials either, that's just lamesauce.
    • Every purchase will be my own decision, I will not overtly take tips.  I will be required to justify each decision based on clear and rational criteria.  This isn't to say I might not ask my friends for opinions on things, but I will never ask "What should I buy?" or accept "Hey, you should buy ____, I think it'll go big."
    • Sometimes I will have to stay in cash, but if I haven't made a move in 2 weeks I will declare game over.  Temporarily, at least.
    • If I lose too much I will declare defeat.
    Now your rules: (otherwise known as a disclaimer)
    • I have absolutely no idea what I am doing.  I am in no way implying that I have developed some super secret methods or intuition.  You will not, under any circumstances, consider what I say as any form of advice.  If I write that I am doing something it is in the interest of disclosure.  If you make any decisions based on what I say, that is your own fault and I cannot be held responsible because this is not advice.
    • What I am doing I am doing as my own personal interest.  It is obviously not my job and outside of any profits I make I am not being paid for any of it.  If AdSense on the side of the official blog make any money, it's a plus but it is not the point.
    • I am not doing this as an endorsement of any official broker or any companies I might invest in.  I do not intend to reflect onto my employer or any related entity.  
    • Please understand that I'm just a dude writing about stocks with no formal training or inside information.

    The plan of attack:


    Since I have a limited amount of money to invest I'm going to be looking exclusively at stocks priced at less than $10 a share.  This is the only way I can make a net profit, any higher and I won't make enough aggregated over the number of shares to amount to counter commissions.

    Since I have no news information other than what is freely available, and most of the companies I'll be looking at just don't make news, I will be relying purely on technical analysis to pick my stocks.  I will also be mitigating my risks using stop loss orders to sell my positions if they drop too far past a level based solely upon an analysis of the chart.

    As I buy and sell positions I will sporadically update the new site (A Stock Market Tale) with details of how I'm doing, and also why I'm moving the way I've decided to.  Hopefully it'll be interesting.

    --PXA