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
4. Fill the forms with :
Close the ImDisk window.
5. Run XBMC installer. On the fourth window of the installer, change the default path (C:\Program Files (x86)\XBMC\) to R:\XBMC\
At the end of the installation, untick the Run XBMC check box.
6. From the start menu (Or any other shortcut you intend to run XBMC from), enter the Properties window.
7. At the end of the target box, add -p parameter (do not omit the space in front of it). Press OK.
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 :
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 :
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
Note
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
4. Fill the forms with :
- Drive letter : R
- Size of virtual disk : 3072
- Size type of virtual disk : Megabytes
Close the ImDisk window.
5. Run XBMC installer. On the fourth window of the installer, change the default path (C:\Program Files (x86)\XBMC\) to R:\XBMC\
At the end of the installation, untick the Run XBMC check box.
6. From the start menu (Or any other shortcut you intend to run XBMC from), enter the Properties window.
7. At the end of the target box, add -p parameter (do not omit the space in front of it). Press OK.
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
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
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 lease 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, so 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