Difference between revisions of "LiveUSB"

From ReactOS Wiki
Jump to: navigation, search
m (Installing the MBR (from 64-bit Windows))
(Preamble: new USB-stack (based on Vgal patches))
(30 intermediate revisions by 14 users not shown)
Line 1: Line 1:
==Preamble==
+
{{Warning|With current versions of ReactOS, USB support is '''NOT''' advanced enough to successfully boot, and ReactOS will crash when it begins loading system USB drivers. See e.g. {{JIRA|7826}}. The following details for older versions are left here for historical reference and for use in the future when this feature becomes supported again.}}
Revision 55555 of [[ReactOS]] introduced support for [[USB]] devices, and after some time it became possible to run the OS from a [[USB]] drive. In revision 55714 ReactOS was successfully installed and running from Patriot Xporter XT 8Gb [[USB]] stick. [[LiveCD]] revision 55995 has also been successfully executed from the same device using [[USB]] 1.1 [[OHCI]].
 
  
Note: To install on a [[USB]]-HDD, it is preferable to use Bootcd; and for a [[USB]] flash drive, it is preferable to use [[LiveCD]]. Differences between installing on [[USB]]-HDD or [[USB]] flash drive are minor, but keep in mind that the resources (speed and storage space) of a [[USB]] flash drive can be much more limited than those of a hard drive. Flash drives also often have a limited lifetime of read and writes before they become damaged or unusable.
+
== Preamble ==
 +
Revision {{rev|55555}} of ReactOS introduced support for [[USB]] devices, and after some time it became possible to run the OS from a USB drive. In revision 55714 ReactOS was successfully installed and running from Patriot Xporter XT 8Gb USB stick. [[LiveCD]] revision 55995 has also been successfully executed from the same device using USB 1.1 [[OHCI]].
 +
 
 +
Since 0.4.13-dev-942-g88cf5b0 revision completely new USB-stack (based on Vgal patches) is enabled. Boot from USB-drives is still very limited (read as "unsupported"). Only RAM-boot method works semi-reliable.
 +
 
 +
Note: To install on a USB-HDD, it is preferable to use Bootcd; and for a USB flash drive, it is preferable to use [[LiveCD]]. Differences between installing on USB-HDD or USB flash drive are minor, but keep in mind that the resources (speed and storage space) of a USB flash drive can be much more limited than those of a hard drive. Flash drives also often have a limited lifetime of read and writes before they become damaged or unusable.
  
 
For more convenient use or testing of LiveUSB mode, you need to know the following things:
 
For more convenient use or testing of LiveUSB mode, you need to know the following things:
* If you install bootcd, the first phase of installation to a virtual HDD in a virtual machine is much faster than directly to the [[USB]]-stick. Therefore later in this article we will consider how to transfer files needed to start the second phase of the installation from a virtual machine to a flash drive/[[USB]]-HDD.
+
* If you install bootcd, the first phase of installation to a virtual HDD in a virtual machine is much faster than directly to the USB-stick. Therefore later in this article we will consider how to transfer files needed to start the second phase of the installation from a virtual machine to a flash drive/USB-HDD.
* If you install [[ReactOS]] to a [[USB]]-drive and install the MBR/VBR using the installer (without formatting the disk), then it is likely that the system will be unable to boot. If you wish to boot more than just [[ReactOS]] from a [[USB]] drive, please refer to the second paragraph of this article.
+
* If you install ReactOS to a USB-drive and install the MBR/VBR using the installer (without formatting the disk), then it is likely that the system will be unable to boot. If you wish to boot more than just ReactOS from a USB drive, please refer to the second paragraph of this article.
 
* You also need a motherboard capable of booting a USB drive.  This guide assumes you have one and that it is already configured.
 
* You also need a motherboard capable of booting a USB drive.  This guide assumes you have one and that it is already configured.
  
==Installing the system to a USB-drive==
+
== Vgal USB state ==
 
+
Vadim Galyant the USB man has lots of work to revive our USB stack, including LiveUSB. You can take a look at the status of his patches '''[[USB|here]]'''.
===Transferring the live system files to USB-drive===
 
* Make sure your USB device is formatted in FAT and there is no valuable data on it
 
* [http://reactos.org/getbuilds Download] a current '''livecd''' image of ReactOS
 
* Now, you have to extract the ISO file to your USB-drive, you should use [http://www.7-zip.org/ 7-Zip] for that. Right-click the ISO file and choose ''Extract files...'' . Choose the drive letter of your USB-drive as the destination.
 
  
===Installing the MBR (NOT for 64-bit Windows)===
+
== Installing the system to a USB-drive ==
To load [[ReactOS]] you can use Grub4Dos. Get the latest version of the archive [http://sourceforge.net/projects/grub4dos/files/GRUB4DOS/ GRUB], as well as  [http://sourceforge.net/projects/grub4dos/files/grubinst/ GUI installer].
 
* Extract the installer, copy to its folder files from GRUB package.
 
* Run the GRUB GUI, choose from the disk list your [[USB]] flash drive (if you're using Windows, then the number can be found in the Disk Manager). Click to install. Close the window with the message about successful installation.
 
* Copy file called "grldr" to your [[USB]] drive.
 
* If a partition on a flash drive is not active, then make it active using any partition management utility.
 
* Create a menu.lst on your USB drive using next template:
 
  
  color blue/green yellow/red white/magenta white/magenta
+
=== Windows ===
timeout 30
+
This process is now extremely simple thanks to Rufus!  Rufus is a Windows/ReactOS application. If you use a different system, you'll need to seek an alternate method (like [[Boot FreeLoader from GRUB|GRUB]] for Linux and BSD users, or [http://www.ubuntu.com/download/desktop/create-a-usb-stick-on-mac-osx diskutil] for Mac users).
default /default
+
# Get the latest version of Rufus from http://rufus.akeo.ie/
+
# [http://reactos.org/getbuilds Download] a current '''livecd''' or '''bootcd''' image of ReactOS
title [[ReactOS]]
+
# Run Rufus (give admin rights if asked), and setup like this:
root (hd0,0)
+
## Select your USB drive from the Device drop-down menu
kernel /freeldr.sys
+
## Select "Create a bootable startup disk using"
+
## Choose "ISO Image" from that drop down menu
title ReactLive
+
## Click the disk icon next to that drop down menu, and select the .ISO file
root (hd0,0)
+
## (Optional) tweak the other Rufus settings – ONLY if you know what you're doing
  kernel /loader/setupldr.sys
+
# Click "Start" in Rufus. Acknowledge that this operating will erase everything currently on your USB driveWait a few moments while Rufus does its magic.
   
+
# Try to boot. (Please do not use a computer where you store important data in order to avoid data loss!)
title reboot
 
reboot
 
  
Done.
+
=== Linux ===
 +
You can make bootable USB stick by [https://github.com/slacka/WoeUSB WoeUSB].
 +
# Optional step: backup your data from the USB stick.
 +
# Get latest version of WoeUSB using your package manager or [https://github.com/slacka/WoeUSB#build-from-source build from source].
 +
# [http://reactos.org/getbuilds Download] a current '''livecd''' or '''bootcd''' image of ReactOS.
 +
# Run woeusbgui from application menu or terminal. Note: it need privileges to make work.
 +
## Choose ''Source: From disk image (iso)''. Then browse to image downloaded before.
 +
## Select target device. If it is not appear check if flash drive is connected and press {{Keyboard|Refresh}} button.
 +
## Press {{Keyboard|Install}} and wait a while.
 +
# Mount the flash drive.
 +
# Edit a configuration file grub2/grub.cfg according to [[Boot FreeLoader from GRUB|Boot FreeLoader from GRUB]] manual. The example of configuration file:
  
===Installing the MBR (from 64-bit Windows)===
+
menuentry "ReactOS" {
To load [[ReactOS]] you can use Grub4Dos. The Grub4Dos installer won't work in 64-bit Windows. As of this writing, the ReactOS VDM isn't mature enough to install Grub4Dos on a USB driveInstead, we'll do it using FreeDOS.
+
    set root=(hd0,1)
 +
    chainloader +1
 +
    parttool (hd0,1) boot+
 +
    multiboot /loader/freeldr.sys
 +
  }
  
* Get the latest versions of [http://sourceforge.net/projects/grub4dos/files/GRUB4DOS/ GRUB], [http://rufus.akeo.ie/ Rufus] (includes FreeDOS), [http://www.7-zip.org/ 7-Zip], and a [http://www.reactos.org/getbuilds ReactOS ISO] (LiveCD or BootCD).
 
* Use Rufus (give it admin rights) to format your flash drive for FreeDOS
 
* Copy the grub4dos folder to the flash drive root (ie. D:\). You may want to rename it so that navigating in FreeDOS is easier. I renamed mine to GRUB.
 
* Copy the file "grldr" from your grub4dos folder to the flash drive root
 
* Boot the flash drive and FreeDOS will load. Now you need to get the disk number of the USB drive.  When it loads, FreeDOS will list all active drives on boot. You will likely have only the USB drive listed.  For me, there was just the flash drive, which it called C:\. The first drive listed is Disk #0, the second is Disk #1, etc. It's VERY important to know your disk number.
 
* Type "CD GRUB" (or whatever you called your grub folder) and hit enter. If you didn't rename the grub folder, you'll have to type "CD GRUB4D~1.4" and hit enter.
 
* This is where you need your disk number. You're going to use the command "bootlace.com" to install grub into the flash drive's MBR.  For Disk #0: "bootlace.com 0x80".  For Disk #1: "bootlace.com 0x81". Etc.
 
* Remove the flash drive, reboot into Windows, and plug the flash drive back in
 
* (optional) Delete everything on the flash drive except "grldr" in the root folder
 
* Create file menu.lst on the root of the flash drive, using the above example. Note that the Disk # is important here too. If your flash drive was Disk #0, then no changes are needed. If it was Disk #1, then change all (hd0,0) references to (hd1,0) and so on for other drive #'s.
 
* Put ReactOS on the flash drive. Follow step A for a LiveCD or a not-yet-installed BootCD. Follow step B to create a pre-installed ReactOS flash drive. NOTE: If you are using a not-yet-installed BootCD, do NOT let ROS modify the filesystem! Keep it as-is, or else you'll have to reformat the USB drive in Windows and start over.
 
* '''Step A''' Use 7-Zip (or a similar utility) to extract the ReactOS ISO contents directly to flash drive root folder
 
* '''Step B''' Setup the ReactOS ISO into VirtualBox (or a similar virtual machine) and complete the installation. Copy all files from the virtual machine to the flash drive root folder. (One way to do this on Windows 7 is to create the virtual machine harddrive as a .VHD file. Then open Control Panel -> Administrative Tools -> Right click Computer Management -> Run as administrator -> right click Disk Management -> Attach VHD -> Select the virtual machine harddisk. Copy files, then right-click the drive in Computer Management and detach the VHD.)
 
* Reboot.  If you followed Step A, choose ReactLive when you boot. If step B, choose ReactOS when you boot.
 
  
 +
Your bootable USB stick is now ready. Unmount it and try to boot.
  
Enjoy!
+
==Testing and sending bug reports==
 +
If it works (hooray!) do NOT let ReactOS change the filesystem or the boot record.  Doing so will render ReactOS unbootable until you repeat the above process.
  
 +
If it doesn't work (damn) it could be either due to a bug in the USB driver or because of a system regression (or regression of driver). Try to use a working revision (check the beginning of the article). If they work then you're dealing with a regression. Please [http://jira.reactos.org/ report] about it to the developers. If they also do not work then your USB controller or USB drive is not yet supported. Please report this too as a new [http://jira.reactos.org/ bug].
  
Try to boot. If it doesn't work (damn) it could be either due to a bug in the [[USB]] driver or because the system regression (or regression of driver). Try to use a working revision (check the beginning of the article). If they work then you're dealing with regression. Please [http://jira.reactos.org/ report] about it to developers. If they also do not work then your [[USB]] controller or [[USB]] drive is not yet supported. Please report this too as a new [http://jira.reactos.org/ bug].
+
== References ==
 +
* [[Boot FreeLoader from GRUB]]
 +
* ReactOS Live-in-RAM USB-stick creation tutorial https://youtu.be/eancDwmWyCw
  
==References==
+
[[Category:Tutorial]]
*[[Boot FreeLoader from GRUB]]
 

Revision as of 18:46, 22 August 2019

Icon speedy deletion.png Warning: With current versions of ReactOS, USB support is NOT advanced enough to successfully boot, and ReactOS will crash when it begins loading system USB drivers. See e.g. CORE-7826. The following details for older versions are left here for historical reference and for use in the future when this feature becomes supported again.


Preamble

Revision r55555 of ReactOS introduced support for USB devices, and after some time it became possible to run the OS from a USB drive. In revision 55714 ReactOS was successfully installed and running from Patriot Xporter XT 8Gb USB stick. LiveCD revision 55995 has also been successfully executed from the same device using USB 1.1 OHCI.

Since 0.4.13-dev-942-g88cf5b0 revision completely new USB-stack (based on Vgal patches) is enabled. Boot from USB-drives is still very limited (read as "unsupported"). Only RAM-boot method works semi-reliable.

Note: To install on a USB-HDD, it is preferable to use Bootcd; and for a USB flash drive, it is preferable to use LiveCD. Differences between installing on USB-HDD or USB flash drive are minor, but keep in mind that the resources (speed and storage space) of a USB flash drive can be much more limited than those of a hard drive. Flash drives also often have a limited lifetime of read and writes before they become damaged or unusable.

For more convenient use or testing of LiveUSB mode, you need to know the following things:

  • If you install bootcd, the first phase of installation to a virtual HDD in a virtual machine is much faster than directly to the USB-stick. Therefore later in this article we will consider how to transfer files needed to start the second phase of the installation from a virtual machine to a flash drive/USB-HDD.
  • If you install ReactOS to a USB-drive and install the MBR/VBR using the installer (without formatting the disk), then it is likely that the system will be unable to boot. If you wish to boot more than just ReactOS from a USB drive, please refer to the second paragraph of this article.
  • You also need a motherboard capable of booting a USB drive. This guide assumes you have one and that it is already configured.

Vgal USB state

Vadim Galyant the USB man has lots of work to revive our USB stack, including LiveUSB. You can take a look at the status of his patches here.

Installing the system to a USB-drive

Windows

This process is now extremely simple thanks to Rufus! Rufus is a Windows/ReactOS application. If you use a different system, you'll need to seek an alternate method (like GRUB for Linux and BSD users, or diskutil for Mac users).

  1. Get the latest version of Rufus from http://rufus.akeo.ie/
  2. Download a current livecd or bootcd image of ReactOS
  3. Run Rufus (give admin rights if asked), and setup like this:
    1. Select your USB drive from the Device drop-down menu
    2. Select "Create a bootable startup disk using"
    3. Choose "ISO Image" from that drop down menu
    4. Click the disk icon next to that drop down menu, and select the .ISO file
    5. (Optional) tweak the other Rufus settings – ONLY if you know what you're doing
  4. Click "Start" in Rufus. Acknowledge that this operating will erase everything currently on your USB drive. Wait a few moments while Rufus does its magic.
  5. Try to boot. (Please do not use a computer where you store important data in order to avoid data loss!)

Linux

You can make bootable USB stick by WoeUSB.

  1. Optional step: backup your data from the USB stick.
  2. Get latest version of WoeUSB using your package manager or build from source.
  3. Download a current livecd or bootcd image of ReactOS.
  4. Run woeusbgui from application menu or terminal. Note: it need privileges to make work.
    1. Choose Source: From disk image (iso). Then browse to image downloaded before.
    2. Select target device. If it is not appear check if flash drive is connected and press Refresh button.
    3. Press Install and wait a while.
  5. Mount the flash drive.
  6. Edit a configuration file grub2/grub.cfg according to Boot FreeLoader from GRUB manual. The example of configuration file:
menuentry "ReactOS" {
   set root=(hd0,1)
   chainloader +1
   parttool (hd0,1) boot+
   multiboot /loader/freeldr.sys
}


Your bootable USB stick is now ready. Unmount it and try to boot.

Testing and sending bug reports

If it works (hooray!) do NOT let ReactOS change the filesystem or the boot record. Doing so will render ReactOS unbootable until you repeat the above process.

If it doesn't work (damn) it could be either due to a bug in the USB driver or because of a system regression (or regression of driver). Try to use a working revision (check the beginning of the article). If they work then you're dealing with a regression. Please report about it to the developers. If they also do not work then your USB controller or USB drive is not yet supported. Please report this too as a new bug.

References