XBMC on RAM Disk
#1
Seeing there's no simple how-to for running XBMC on RAM Disk using Microsoft Windows, here's a shot at it.
Please note that this is a Work-In-Progress, meaning please be kind to errors. Suggestions are greatly appreciated and immensely needed.

What we need
1. Microsoft Windows
2. XBMC Installer, either Stable Release or Nightly Builds
3. ImDisk Virtual Disk Driver by Olof Lagerkvist

Steps
1. Install ImDisk Virtual Disk Driver

2. Open the ImDisk applet from Control Panel.

3. Create a new disk by pressing the Mount New button
Image

4. Fill the forms with :
  • Drive letter : R
  • Size of virtual disk : 3072
  • Size type of virtual disk : Megabytes
And press OK.
Close the ImDisk window.
Image

5. Run XBMC installer. On the fourth window of the installer, change the default path (C:\Program Files (x86)\XBMC\) to R:\XBMC\
Image

At the end of the installation, untick the Run XBMC check box.
Image

6. From the start menu (Or any other shortcut you intend to run XBMC from), enter the Properties window.
Image

7. At the end of the target box, add -p parameter (do not omit the space in front of it). Press OK.
Image



Now you can test run XBMC from the RAM Disk to confirm all is working well.


To automatically populate RAM Disk with XBMC program folder at login, do the following :

1. Copy XBMC program folder (R:\XBMC) to, let's say, the root drive of C (C:\XBMC Backup Folder), resulting in a folder structure : C:\XBMC Backup Folder\XBMC

2. Using notepad, paste the following code :
Code:
echo off
cls
echo Invoking RAM Drive...
echo.
c:\windows\system32\imdisk -a -t vm -s 3072M -p "/fs:ntfs /V:RAMDisk /q /y" -m R:
echo.
echo Creating XBMC working folder...
echo.
md R:\XBMC
echo         Done.
echo Synchronizing XBMC program directory...
echo.
xcopy "C:\XBMC Backup Folder\XBMC" R:\XBMC /E /H /K /Q
echo.
echo Running XBMC on RAM Drive...
echo.
R:
cd R:\XBMC
start XBMC.exe -p
exit
And save it on the backup folder C:\XBMC Backup Folder as a batch file.
Give it a self-explanatory name, such as XBMC on RAMDisk.bat

3. Create a shortcut pointing to the batch file and save it on the startup folder (C:\Users\[USERNAME]\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup
Do not point the shortcut to the All User startup folder (C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Startup) as it will execute on another user's login activity, including Guests and RDPs.


To backup XBMC to the assigned backup folder and re-run XBMC, do the following :

1. Using notepad, paste the following code :
Code:
echo off
cls
echo.
echo Synchronizing XBMC program directory...
echo.
echo Securing fallback...
ren C:\XBMC Backup Folder\XBMC "XBMC Backup In Progress"
echo Creating container...
md "C:\XBMC Backup Folder\XBMC"
echo Execute backup...
xcopy R:\XBMC "C:\XBMC Backup Folder\XBMC" /E /H /K /Q
echo.
echo Running XBMC on RAM Drive...
echo.
R:
cd R:\XBMC
start XBMC.exe -p
echo Purge fallback...
rd "C:\XBMC Backup Folder\XBMC Backup In Progress" /s /q
exit
And save it on the backup folder C:\XBMC Backup Folder as a batch file.
Give it a self-explanatory name, such as XBMC Backup.bat

2. Create a shortcut pointing to the batch file and save it on, say, Desktop or any other place easily reachable. Run this shortcut periodically or before the computer goes off / restarting.




To do
  • Auto backup on shutdown
  • Automatic periodic backup
  • Ignore temp directory on backup
  • Try out normal non-portable installation method using symbolic lists


Note
  • This should be written at the beginning of the post, but here goes. The advantage of using RAM Disk in general is mostly speed. It's like replacing an HDD to an SSD, but in XBMC terms.
    And it theoretically reduces wear on mechanical drives and eliminating wake time delay caused by mechanical drives going idle after a certain time of inactivity; or write cycles of SSDs.
  • Default installation of XBMC 11.0 (Stable Release) should take no more than 100MB.
    In this walkthrough I assigned 3 GBs of space to accomodate thumbnails, skins, add-ons, etc. In the end it all depends on your XBMC configurations and RAM available. I'm recommending at least 1 GBs (1024 MBs) of space.
  • If request arise, I'll make another tutorial on how to save file as batch file. But for now I'm going to assume most XBMC readers are tech savvy enough.
  • The backup script can off course be executed through the Task Scheduler, but this is something I haven't yet done nor test myself (Mostly since i never shut down my HTPC). Anyone who's willing to test it under several scenarios (Proper shutdown; Restart; Log Off; User switch; Sleep; Hibernate; etc) would be greatly appreciated.
  • For each update especially for users running Nightly Builds, each update resets the shortcut, meaning we need to redo the shortcut mod after each installs.
  • Simple variables that can be changed according to your HTPC configurations are as follows:
    • RAM Disk drive size (Default 3GB) - 2 references
    • Backup path and folder name (Default C:\XBMC Backup Folder) - 5 references
    • XBMC working folder path and folder name (Default R:\XBMC) - 5 references
  • To users running Linux, there's a thread for that :Anyone running RAM Disk? that leads to the thread : [HOWTO] Create a persistent xbmc ramdisk in ubuntu (xbmclive)
  • Off topic, but if I made any grammatical error or weird phrasing on this post, a correction would be nice

Reply


Messages In This Thread
XBMC on RAM Disk - by Palthron - 2012-10-29, 05:29
RE: XBMC on RAM Disk - by baijuxavior - 2012-10-29, 06:22
RE: XBMC on RAM Disk - by Palthron - 2012-10-29, 06:27
RE: XBMC on RAM Disk - by Palthron - 2012-10-29, 08:31
RE: XBMC on RAM Disk - by LordMerlin - 2012-10-29, 10:46
RE: XBMC on RAM Disk - by Palthron - 2012-10-29, 10:51
RE: XBMC on RAM Disk - by Palthron - 2012-10-30, 07:29
RE: XBMC on RAM Disk - by rumpleforeskin - 2012-10-30, 11:49
RE: XBMC on RAM Disk - by LordMerlin - 2012-10-30, 14:14
RE: XBMC on RAM Disk - by Palthron - 2012-10-31, 08:47
RE: XBMC on RAM Disk - by LordMerlin - 2012-10-31, 11:37
RE: XBMC on RAM Disk - by Livin - 2012-12-14, 08:17
RE: XBMC on RAM Disk - by Palthron - 2012-12-30, 22:41
RE: XBMC on RAM Disk - by Livin - 2012-12-20, 00:32
Logout Mark Read Team Forum Stats Members Help
XBMC on RAM Disk0