Virtulization Tips / Trick / Etc


Recommended Posts

unRAID Virtual Boot Drive

 

Wanted to share something with the community for a while now, but things were just very busy. Anyway.

 

Back when I virtualized my unRAID, I could not deal with the slow boot up's of the pass-thru usb stick booting via plop installed on a vmdk (which does not always see the usb key). Seems to run at 1.1 USB speeds. So while working with a secondary Dev unRAID VM, the free 3 drive version, using 3 vmdk's not to large in size, I learned how the boot process worked, amongst other things (all the time). I use it alot before moving packages, etc.. to my production unRAID VM.

 

So I created this post to share some tips, tricks, and misc others. Hope others add some of their as well.

 

You can download the zipped vmdk from: unRAID_5B12a_VMDK.rar (90.63MB)

 

Unzip and upload to your unRAID VM folder in the datastore. For does who do not know a vmdk consists of 2 files (first file is the specifications settings/parameters & the second (-flat)being the actual file that stores the data), once both are copied to a datastore it is seen as one file with the nice VM vmdk icon ;) I have set it to be a thick disk.

 

So now all you need to do is select to add a "Hard Disk", then select "Use an existing virtual disk", then recommend check off "Independent" and tick off "Persistent". I made the vmdk 100MB which is just enought to hold the required files (listed below) and will boot and work, but recommend you bump it up (300-500MB or what works for you, I will explain later.)

 

Don't click "OK", select the "SCSI controller" it added and select "Change Type" and select "LSI Logic SAS", this is not a requirement but a recommendation as well. Now click "OK".

 

I prefer not to have a CD nor floppy etc. assigned/added to the unRAID VM so you can remove those as well if you wish.

 

Q56M0.png

 

OsKM4.png

 

File list in vmdk:

bzimage

bzroot

ldlinux.sys

memtest

menu.c32

syslinux.cfg

 

Baselined at unRAID 5.0 Beta12a. So you really dont need these files on your usb stick any more, but I recommend you keep them all there (will explain).

I set this vmdk's volume name to "BOOT", I also edited the "syslinux.cfg" file to lower the default timeout of 50 to 30, this will give 3 seconds before booting unRAID or selecting memtest.

 

So now when you power up your unRAID VM it will boot immediately off this vmdk, and loads to RAMDisk, Tom's code is set to look for a volume called "UNRAID" which is your usb stick and reads and loads your license, configuration, packages, customizations, all from your usb stick. This boot up is way faster this way (I've only seen faster booting on physical HW with a zeon processor). This can be done the same way physically but you would tying up a Hard Drive and port.

 

So now say you dont want this version of unRAID, or Tom blesses us with another Beta or 5 RTM :)

 

Always follow Tom's upgrade instructions. Which is always to stop the array, usually flat file copy of bz files, you would be updating the usb stick (as you are accessing the flash share which is mounted to your usb stick, which is good).

 

Option #1 (more for beginners)

Shutdown unRAID (which you would have to anyway). Pick another VM (XP, W2K, W2K3, W2k8, you didnt virtualize to not run other VMs right :)). Select to add another "Hard Disk" to this selected VM and select "Use an existing virtual disk" browser to your unRAID VM select the unRAID.vmdk. Start the VM, browse to this additional drive (volume is named "BOOT") backup the current BZ Files or anything else Tom requested updating (ex. bzimage_5B12a). Now copy the new files in into it (This is why you want to bump up the vmdk larger than 100MB, so you can keep backups). Shutdown the VM, remove the "Hard Disk". Start up your unRAID VM, there you go your running the next version!

 

Option #2 (more advanced but faster to upgrade/down grade)

Telnet or SSH into unRAID, run "blkid /dev/sda1" (your vmdk boot volume may not be sda1! change it to what yours is.) . This will get you the UUID of the vmdk drive.

example output: /dev/sda1: LABEL="BOOT" UUID="9431-4C95" TYPE="vfat"

(Now just edit your go script and add the following 2 lines to it, I personally put these entries at the very end.)

mkdir /mnt/vmdk

mount -t vfat -U 9431-4C95 /mnt/vmdk (change to your UUID)

(run these 2 command now since your telnet/ssh'ed in getting the UUID, this way you dont have to wait for a reboot as you inputted the lines into your GO script.)

So now everytime you reboot it will auto mount your vmdk (boot volume) under mnt/vmdk, just use something like WinSCP and you can backup the current files and copy the new flat files right to the boot volume (your vmdk) or via telnet/ssh copy from /mnt/boot to /mnt/vmdk. So you updated your flash (usb stick) and boot volume on the fly and all you need to do is reboot and your running the new version. Easy breezy.

 

 

NOTE: Dont assign your vmdk "boot" volume to the array, it is very easy to distinguish it. Otherwise you will wipe it and will not be able to boot back up next time. If this were to happen you could remove the disk from the vm, delete the vmdk from the datastore and recopy the supplied vmdk you download. There are no customization's stored on it so not the end of the world. But I would really be surprised if someone actually assigned it then started the array and formatted it...

 

EqCQx.png

 

 

Link to comment

Plop Linux

 

Plop is another popular tool, as a boot manager mostly for USB boots from VMs.

 

I created a thin provision vmdk (set to grow to 100MB can be change to anyone's preference) with the lastest stable Plop linux install (v4.1.2) and is only a 1MB vmdk.

You can download the zipped vmdk from: ploplinux-4.1.2_VMDK.rar (35.59KB)

 

Unzip and upload to your unRAID VM or any other VM's folder in the datastore that you need it for.

 

I already preset to only list USB boot with a 5 second count down. Anyone can select "setup" and modified to any other settings they prefer or reset to default.

 

 

Link to comment

USB Image Tool

 

I use this tool alot for varies things. First its free. Not complicated at all, and what it does it does really well.

 

I backup all my ESXi usb stick, especially before performing upgrades, like from ESXi 4.1u1 to 5.0.

 

One of the best feature is that you can restore to a smaller sized usb stick than what the image was taken from!

 

Have you noticed or run into the following. 2 or more usb stick all sold as 4GB, after format one is 3.96GB the other is say 3.85GB. Normally if you image the 3.96GB stick you cannot restore it on the 3.58GB stick, and there are time I want to down size something I put on a 8GB stick to a 4GB Stick. USB Image Tool will do it with easy. There is a warning, but it's understandable.

 

In plain english, if the USB stick had 3GB worth of data only you can restore the image to a smaller stick as it still has room for 3.85GB. But If you had say an 8GB stick with 3.98GB of data and try to move it to either of does 4GB stick, you will have data lose for sure  :'(

 

Check it out: http://www.alexpage.de/usb-image-tool/

 

Jfd58.png

Link to comment

VMXNET3 10G

 

Getting the VMXNET3 driver loaded (without any hard modifications)

 

The following is all you need to do:

 

Stage the latest plg VMTools Package (by zeron to /boot/config/plugins):

http://lime-technology.com/forum/index.php?topic=11449.0  (Huge thanks to Zeron for this and keeping up with the beta's and fastest turn around times  ;))

 

Edit your go script with the following entries before ANYTHING else:

 

  1) depmod -a

  2) ifconfig eth0 up

  3) /etc/rc.d/rc.inet1 start

 

Never mind, our friend has incorporated whats require to initialize the nic now:

Automatically start VMXNET3 based on madburg's info here: http://lime-technology.com/forum/index.php?topic=11449.msg152043#msg152043

 

Now shutdown your (unRAID) VM, remove the current nic you had assigned (passthru or E1000)

 

Add a VMXNET3 NIC. Save your changes.

 

Power on your unRAID VM. Enjoy.

 

 

Would be great if Tom added the vmxnet3 driver in (complete tools even better)  ;D.

 

Link to comment
  • 1 month later...

Thanks for this.

 

If I am using plop, so I need the first option?

 

It makes sense in a VM to add a boot drive instead of booting from teh USB stick and just use the USB for licensing purposes.  Would like to see that as an option with the RTM as virtualising UnRaid is becoming popular and disks are "free".

 

Mick

Link to comment

unRAID Virtual Boot Drive

 

Option #2 (more advanced but faster to upgrade/down grade)

Telnet or SSH into unRAID, run "blkid /dev/sda1" (your vmdk boot volume may not be sda1! change it to what yours is.) . This will get you the UUID of the vmdk drive.

example output: /dev/sda1: LABEL="BOOT" UUID="9431-4C95" TYPE="vfat"

(Now just edit your go script and add the following 2 lines to it, I personally put these entries at the very end.)

mkdir /mnt/vmdk

mount -t vfat -U 9431-4C95 /mnt/vmdk (change to your UUID)

(run these 2 command now since your telnet/ssh'ed in getting the UUID, this way you dont have to wait for a reboot as you inputted the lines into your GO script.)

So now everytime you reboot it will auto mount your vmdk (boot volume) under mnt/vmdk, just use something like WinSCP and you can backup the current files and copy the new flat files right to the boot volume (your vmdk) or via telnet/ssh copy from /mnt/boot to /mnt/vmdk. So you updated your flash (usb stick) and boot volume on the fly and all you need to do is reboot and your running the new version. Easy breezy.

 

Since the filesystem has a label you can mount it via Label with

 

mount -L BOOT /mnt/vmdk

 

This makes it easier in not having to know the uuid as the environment will look for a filesystem named BOOT on all drives.

 

If you look at the /etc/fstab, that is how the UNRAID volume is found and mounted.

Link to comment

unRAID Virtual Boot Drive

 

Option #2 (more advanced but faster to upgrade/down grade)

Telnet or SSH into unRAID, run "blkid /dev/sda1" (your vmdk boot volume may not be sda1! change it to what yours is.) . This will get you the UUID of the vmdk drive.

example output: /dev/sda1: LABEL="BOOT" UUID="9431-4C95" TYPE="vfat"

(Now just edit your go script and add the following 2 lines to it, I personally put these entries at the very end.)

mkdir /mnt/vmdk

mount -t vfat -U 9431-4C95 /mnt/vmdk (change to your UUID)

(run these 2 command now since your telnet/ssh'ed in getting the UUID, this way you dont have to wait for a reboot as you inputted the lines into your GO script.)

So now everytime you reboot it will auto mount your vmdk (boot volume) under mnt/vmdk, just use something like WinSCP and you can backup the current files and copy the new flat files right to the boot volume (your vmdk) or via telnet/ssh copy from /mnt/boot to /mnt/vmdk. So you updated your flash (usb stick) and boot volume on the fly and all you need to do is reboot and your running the new version. Easy breezy.

 

Since the filesystem has a label you can mount it via Label with

 

mount -L BOOT /mnt/vmdk

 

This makes it easier in not having to know the uuid as the environment will look for a filesystem named BOOT on all drives.

 

If you look at the /etc/fstab, that is how the UNRAID volume is found and mounted.

 

Sweet thanks for that info! Completely agree, that is a better approach. As long as they keep that volume name (or change it to the volume name they changed it to.)

Link to comment

Thanks for this! I just loaded it, and you're correct, the boot is super fast!

 

So my question is this, do I continue to install things to my BOOT Flash Drive, or the VMDK?  For instance, do I put unMenu on the VMDK or BOOT drive?

 

The VMDK is at 5b12.  I'm using 5b13 on my old BOOT USB.  If I want to upgrade to 5b14, where do I update it on the VMDK or the BOOT USB?

 

Thanks!

Link to comment

Thanks for this! I just loaded it, and you're correct, the boot is super fast!

 

So my question is this, do I continue to install things to my BOOT Flash Drive, or the VMDK?  For instance, do I put unMenu on the VMDK or BOOT drive?

 

The VMDK is at 5b12.  I'm using 5b13 on my old BOOT USB.  If I want to upgrade to 5b14, where do I update it on the VMDK or the BOOT USB?

 

Thanks!

 

If you look at the files it vmdk its just the boot image (the version of unRAID you will boot into). Everything else goes to the usb stick. As I stated in the post I highly recommend you keep the boot image sync'ed between the two. You need to Re-Read that post... all the answers are there and why.

Link to comment

Since the filesystem has a label you can mount it via Label with

 

mount -L BOOT /mnt/vmdk

 

This makes it easier in not having to know the uuid as the environment will look for a filesystem named BOOT on all drives.

 

If you look at the /etc/fstab, that is how the UNRAID volume is found and mounted.

 

OK. I'm trying to get the BOOT mountpoint to be viewable/writable from the network.

I have in my go script

mkdir /mnt/UNRAIDBOOT
chmod 0777 /mnt/UNRAIDBOOT
mount -L UNRAIDBOOT -o rw /mnt/UNRAIDBOOT

 

but when I check out /mnt/UNRAIDBOOT it is 755 instead of 777

 

I have in my /boot/config/smb-extra.conf

[uNRAIDBOOT]
        path = /mnt/UNRAIDBOOT
        comment = UNRAIDBOOT vmdk share
        browseable = yes
        # Public
        public = yes
        writeable = yes
        map archive = No
        map system = No
        map hidden = No
        map readonly = Yes
        create mask = 0777
        directory mask = 0777

 

 

I've tried umask 000 prior to the mkdir, I've tried chmod 777 /mnt/UNRAIDBOOT after the mkdir.....

 

I'm able to see UNRAIDBOOT from Windows machines, but unable to write to it.

 

What am I missing?

 

 

 

 

Link to comment

Let me know if I am missing something so that the following would not work properly.

 

From my understanding, the only difference between the versions are the bzimage & bzroot files.

 

So I renamed all the various bzimage/bzroot files to a format of bzimage<version>/bzroot<version> (ie. bzimage5b14, bzroot5b14)

Then I copied all to my BOOT vmdk

 

I then made my syslinux.cfg as below, a seperate menu item for each version.

That way easy method to switch between versions for testing, or using the same BOOT vmdk for multiple unRaid VMs at different versions.

 

default menu.c32
menu title Lime Technology LLC
prompt 0
timeout 90
label unRaid 5b14
  menu default
  kernel bzimage5b14
  append initrd=bzroot5b14
label unRaid 5b13
  kernel bzimage5b13
  append initrd=bzroot5b13
label unRaid 5b12a
  kernel bzimage5b12a
  append initrd=bzroot5b12a
label unRaid 5b12
  kernel bzimage5b12
  append initrd=bzroot5b12
label unRaid 5b11
  kernel bzimage5b11
  append initrd=bzroot5b11
label unRaid 5b9
  kernel bzimage5b9
  append initrd=bzroot5b9
label unRaid 5b8d
  kernel bzimage5b8d
  append bzroot5b8d
label Memtest86+
  kernel memtest

Link to comment

Hi folks and happy new year.

 

Quick question ..

I know the vmdk is only used for fast boot, and all the config files etc are on the USB key.

 

But is there a way to still mount that vmdk and use it for local storage.?

 

I'm thinking of keeping my plugin/apps there.

The rational is I want some space that is not dependent on the array being available.

 

 

Link to comment

Let me know if I am missing something so that the following would not work properly.

 

From my understanding, the only difference between the versions are the bzimage & bzroot files.

 

So I renamed all the various bzimage/bzroot files to a format of bzimage<version>/bzroot<version> (ie. bzimage5b14, bzroot5b14)

Then I copied all to my BOOT vmdk

 

I then made my syslinux.cfg as below, a seperate menu item for each version.

That way easy method to switch between versions for testing, or using the same BOOT vmdk for multiple unRaid VMs at different versions.

 

default menu.c32
menu title Lime Technology LLC
prompt 0
timeout 90
label unRaid 5b14
  menu default
  kernel bzimage5b14
  append initrd=bzroot5b14
label unRaid 5b13
  kernel bzimage5b13
  append initrd=bzroot5b13
label unRaid 5b12a
  kernel bzimage5b12a
  append initrd=bzroot5b12a
label unRaid 5b12
  kernel bzimage5b12
  append initrd=bzroot5b12
label unRaid 5b11
  kernel bzimage5b11
  append initrd=bzroot5b11
label unRaid 5b9
  kernel bzimage5b9
  append initrd=bzroot5b9
label unRaid 5b8d
  kernel bzimage5b8d
  append bzroot5b8d
label Memtest86+
  kernel memtest

The only issue you might run into is that the renamed files may not work if they are more than 8 characters long. 

(legacy FAT file system limitation when parsed by some of the syslinux utilities)

Link to comment

Hi folks and happy new year.

 

Quick question ..

I know the vmdk is only used for fast boot, and all the config files etc are on the USB key.

 

But is there a way to still mount that vmdk and use it for local storage.?

 

I'm thinking of keeping my plugin/apps there.

The rational is I want some space that is not dependent on the array being available.

 

To me it makes sense to do so and I have my twonkyserver and snap residing on the virtual drive.  It should be faster with Twonky at a guess.

 

The only reason I can think of not to do so is if you want to remove the USB and use it on a different machine (testing etc.) then it will faill to load all the packages.

 

NOw I am no expert with UnRaid, just started with it and I know nothing about linux so the above could all be hot air.

 

Mick

Link to comment

It would work just fine with the limitations mentioned.

 

On occasion i do reboot my server straight into unraid bypassing EXSi for testing. but that is usually rare.

In a case like that, you would have issues.

 

I also have 2 more norco's with the same motherboards inside of them. if I had to, I could pull my usb flash and hot swap drives and be up and running in a few seconds on a new box if i had some major hardware failure.

I doubt that would be an issue in your case.

Link to comment

i am doing some testing with this so I can confirm before I commit the changes to the production machine.

 

A couple of questions

 

You say you can change the size, which i did, but the file system still thinks it s 100mb (df command).  I have it set at 2Gb, but its still only using 100mb.  how do I resize it so the filesystem is using the whole allocated space (tried GParted on the "drive" but it failed).

 

Can you explain how you created this bootable drive for unraid.  i suspect I may have to do the same on a larger drive if the above is not possible.

 

How can you make the /mnt/vmdk available via SMB?

 

Thanks

 

Mick

Link to comment
  • 4 weeks later...

Let me know if I am missing something so that the following would not work properly.

 

From my understanding, the only difference between the versions are the bzimage & bzroot files.

 

So I renamed all the various bzimage/bzroot files to a format of bzimage<version>/bzroot<version> (ie. bzimage5b14, bzroot5b14)

Then I copied all to my BOOT vmdk

 

I then made my syslinux.cfg as below, a seperate menu item for each version.

That way easy method to switch between versions for testing, or using the same BOOT vmdk for multiple unRaid VMs at different versions.

 

default menu.c32
menu title Lime Technology LLC
prompt 0
timeout 90
label unRaid 5b14
  menu default
  kernel bzimage5b14
  append initrd=bzroot5b14
label unRaid 5b13
  kernel bzimage5b13
  append initrd=bzroot5b13
label unRaid 5b12a
  kernel bzimage5b12a
  append initrd=bzroot5b12a
label unRaid 5b12
  kernel bzimage5b12
  append initrd=bzroot5b12
label unRaid 5b11
  kernel bzimage5b11
  append initrd=bzroot5b11
label unRaid 5b9
  kernel bzimage5b9
  append initrd=bzroot5b9
label unRaid 5b8d
  kernel bzimage5b8d
  append bzroot5b8d
label Memtest86+
  kernel memtest

 

Great idea! Will be perfect for my fully virtual dev unRAID VM. I would just keep the names short as meantioned. Also I would play with picking up what beta version was loaded and then load the proper vmtools version based on that. Good stuff. Thanks for sharing!

Link to comment

iYou say you can change the size, which i did, but the file system still thinks it s 100mb (df command).  I have it set at 2Gb, but its still only using 100mb.  how do I resize it so the filesystem is using the whole allocated space (tried GParted on the "drive" but it failed).

 

Its set as a THIN vmdk so it will only grow as you use the space up. So say u changed it to 2GB (from 100mb), once you place more than 100MB of data you will notice the vmdk (flat file) grow in size. In high I/O you would want it to be a THICK vmdk so it would not grow (file is set to the size you wanted allocated), as they is a preformance hit with that. Nothing you will see with what you are doing here. But if you want to mess around change it to a THICK vmdk.

 

Link to comment

Let me know if I am missing something so that the following would not work properly.

 

From my understanding, the only difference between the versions are the bzimage & bzroot files.

 

So I renamed all the various bzimage/bzroot files to a format of bzimage<version>/bzroot<version> (ie. bzimage5b14, bzroot5b14)

Then I copied all to my BOOT vmdk

 

I then made my syslinux.cfg as below, a seperate menu item for each version.

That way easy method to switch between versions for testing, or using the same BOOT vmdk for multiple unRaid VMs at different versions.

 

default menu.c32
menu title Lime Technology LLC
prompt 0
timeout 90
label unRaid 5b14
  menu default
  kernel bzimage5b14
  append initrd=bzroot5b14
label unRaid 5b13
  kernel bzimage5b13
  append initrd=bzroot5b13
label unRaid 5b12a
  kernel bzimage5b12a
  append initrd=bzroot5b12a
label unRaid 5b12
  kernel bzimage5b12
  append initrd=bzroot5b12
label unRaid 5b11
  kernel bzimage5b11
  append initrd=bzroot5b11
label unRaid 5b9
  kernel bzimage5b9
  append initrd=bzroot5b9
label unRaid 5b8d
  kernel bzimage5b8d
  append bzroot5b8d
label Memtest86+
  kernel memtest

 

Great idea! Will be perfect for my fully virtual dev unRAID VM. I would just keep the names short as meantioned. Also I would play with picking up what beta version was loaded and then load the proper vmtools version based on that. Good stuff. Thanks for sharing!

Just an FYI.

 

The multiple entries for multiple versions works perfectly. I use the same scheme here, but there is one catch.

The file names for syslinux must be valid file names under MS-DOS.  (8 character name, 3 character extension)

 

Now, this might have changed since I ran into that limitation, or may not apply in the vmdk world, but it sure applied to the USB flash drive I was booting from.

 

Joe L.

Link to comment

Great thanks for the info Joe L., hope all is well. I've been busy. Hoping to jump back in one day and start coding for unRAID, have lots to great idea's plus with what so many already have publish, 5.0 Final could mean a bad A$$ product. But work has me tied up still. Thanks you everything espically in the earlier days  :)

Link to comment
  • 7 months later...

greywolf, thanks again for adding/posting the boot menu trick, works like a charm.

 

JoeL. I have confirmed that the 8 character name, 3 character extension is a none issue here, using a vmdk formated in fat32 at least. Thank you for the heads up though.

Ex. Longest name I have used for far "bzimage5b12a", in the syslinux.cfg

 

Just wanted to share in case others readers question if it ever worked.

 

 

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.