Showing posts with label virtual. Show all posts
Showing posts with label virtual. Show all posts

Friday, September 26, 2014

Light Virtual Machine Manager


Virtual machine applications such as VMware or VitualBox is very popular, but is there a similar application a more "lightweight" and is opensource? One of the alternatives that we ask is that once was only running Qemu on UNIX-family operating system platforms (including Linux).


At present, Qemu has been created which version can be run on the Windows operating system platform. In this article we exemplify a few steps how to install the operating system using Mikrotik (one Linux distro) to networked learning. Heres his speech:

  1. Download and install Qemu Package Manager.
  2. Run Qemu Manager. We are a new form of virtual machine to a virtual operating system that we want to install. Click the plus sign button (the Create New VM). In the dialog box of the New Virtual Machine Wizard, type a name for the new virtual machine identifier, let other options. Select the type of operating system platforms at the field Operating System. Click the Next button.
  3. Specify the allocation size of the memory RAM to be used by the virtual machine to the new Memory Size. Specify also the allocation of space on the hard disk size for the virtual machine to the new Disk Image Size. Click the Next button.
  4. Click the Finish button. New Virtual machine as a "container" operating system we are going to install is already formed.
  5. Now we set some of its settings. On the Virtual Machines, highlight the name of the virtual machine. Go to the Hardware tab. Click on the Network cards in quick succession.
  6. If we want the virtual machine also has a connection to a network, the Network card dialog box select the VLAN Type = TAP Networking. Click Select network adapter in the TAP.
  7. On the Network Adapter dialog box, Tap, click the plus sign button.
  8. Then in the dialog box Qemu Manager TAP Installer Setup, click the Install button.
  9. If a warning box appears, click the Continue Anyway button.
  10. Back in the settings of the virtual machine settings, open the tab Drives. Click on the CD ROM in the future.
  11. If we want to install the operating system from an ISO IMAGE file in, click the button point harddsik two. Navigate to the ISO file in the operating system hard disk, and then click Open and OK button.
  12. If we want to install the operating system from CD/DVD disc, click Use Physical Drive, and then navigate to the drive letter of the CD/DVD ROM and click the OK button.
  13. Back in the settings of the virtual machine settings, still on the Drives tab. Click on the Boot Order in the future. If we are going to install the new operating system from CD/DVD ROM drive, put the drive on the top of the order, and then click the OK button.
  14. Once everything is ready, click the Play arrow button (Launch Selected VM) at the top of the screen.
  15. New operating system start installed into virtual machine we already prepare.
  16. After installation of the operating system into a virtual machine is finished, remove the pieces of CD/DVD from the CD/DVD ROM DRIVE and turn off the virtual machine by clicking the Stop button Selected VM. If a warning box appears, click the Yes button.
  17. Restart the virtual machine has finished installed.

I hope this article was helpful.

Monday, September 8, 2014

Virtual SD card on Android


Since Android Honeycomb, Google changed the way to manage internal memory on Android devices. Before Honeycomb, every user had one separate partition on his device called userdata (/data), where he could install applications and where all user settings were stored (home Lcds, applications data, contacts, and all the rest you loose after doing so called "full wipe" on your device). Apart of userdata partition, all Android devices had microSD card slot to save pictures, movies, backups etc.. Now it looks completely different, but lets start from the beginning. There are several approaches to this subject, Ill present here all those I am aware of.


  • userdata partition + microSD card

This is the mentioned above pre-Honeycomb approach. There is userdata partition, where you can install all your applications and you also have a possibility to insert microSD card. Nothing more to explain. Only devices running Android Gingerbread and older versions have such configuration, so its getting less and less popular.


  • userdata partition + virtual SD card on userdata partition

This is the new approach presented for the first time in Honeycomb. Instead of having /data partition together with expandable microSD card slot of any capacity, Google decided for something different. Instead, /data partition became very large (16/32/64 GB) and inside you can find /data/media folder that contains all the files you can see as your SD card content. How does it work? Without too much technical explanations, there is so called fuse tool which emulates media folder inside userdata partition as a separate storage device. As a result, after connecting smartphone to the PC you can browse the content of /data/media location, so if it was a microSD card. The biggest downside of such approach is a high risk of loosing all your virtual SD card content in case of any serious /data partition failure. Also, such partition cant be formatted with mkfs.ext4 without loosing content of virtual SD card, because you cant format device partition just partially. You can use e2fsck tool to check for potential errors, but sometimes partition format is the only way out. How does "full wipe" work then? Well, its a little bit complicated. First of all, you cant format mounted (in use) partition. You need to unmount it first. Once unmounted userdata partition, you cant flash any ZIP file from inside recovery, because ZIPs files are stored on virtual SD card (/data/media) and remember that userdata partition is currently unmounted, because we want to format it. There is a workaround for it - you can run mkfs.ext4 from inside /cache partition or you can use command prompt. Now, what if you need to remove the whole content of your userdata partition, but you want to keep virtual SD card content at the same time? There is a workaround for this as well, but instead of formatting entire partition, you need to remove all files excluding /data/media location. Example:

#!/tmp/bash
# Remove content of /data partition excluding data/media files
cd /data
FILES=(*)
for i in *; do
if [ "$i" != "media" ]
then rm -R "$i"
fi
done


This way you can sort of wipe userdata, but it doesnt format the partition, so you cant fix broken file-system with it.  Why this point is the longest one? Because it took me quite a few words to explain the relation between virtual SD card and media folder on userdata partition (/data/media). So basically, what you read here applies to every configuration with virtual SD card emulated on userdata partition.


  • userdata partition + virtual SD card on a separate partition

This approach is not very popular, and its a shame because it seems to be much more practical rather than the previous one. Instead of emulating SD card from userdata partition, there is a separate, large partition with vFAT file-system. That means you can format your userdata partition anytime you want without loosing content of your virtual SD card, or from inside custom ROM, because userdata can be freely unmounted. The only device Ive seen so far with this approach was HTC One X.


  • userdata partition + virtual SD card on userdata partition + microSD card

This seems to be the most desirable solution for many Android users. It works similar to approach described in the second point, so everything I wrote about /data/media is valid here as well. However, every user have the ability to insert extra microSD card inside his device, so he can easily backup virtual SD card to microSD card or format userdata partition without loosing all pictures etc. (if previously stored on microSD card). This is the most common configuration for Samsung devices. But having removable microSD card is not only an advantage. First of all, any kind of microSD card (even SDHC) will be always slower than internal eMMC memory. It depends on many factors like card speed (class 2, 4, 6, 8 or even 10), on-board controller, I/O scheduler and more. Secondly, microSD card damage risk is higher then damage risk of internal eMMC memory. Out of question is the benefit to expand the memory with 64 GB microSD card, but its definitely the minority of power users, who are buying large capacity cards. For the vast majority of users, internal memory with 32 GB capacity is more then enough to store their favorite music or pictures.


  • userdata partition + virtual SD card on a separate partition + microSD card

This approach is theoretically possible, but personally Ive never seen device with such combination. For me, this is the best combination. You have possibility to use external microSD card and virtual SD card is not a part of userdata partition, but it has its own, separate vFat partition. Such configuration gives you control over all your data and possibility to manage it however you want.