Creating VirtualBox-Image as "harddisk" by shell-script

 
Thread Tools Search this Thread
Special Forums UNIX and Linux Applications Virtualization and Cloud Computing Creating VirtualBox-Image as "harddisk" by shell-script
# 1  
Old 03-10-2010
Creating VirtualBox-Image as "harddisk" by shell-script

Hello,

I'm trying to create a VirtualBox "harddisk" and put an dd-image into it. This image shoudn't work as a virtual maschine, I just want to be able to mount it to an folder. How can I do this with an shell script?


Sebi

---------- Post updated at 10:36 AM ---------- Previous update was at 09:36 AM ----------

Okay, I found a way to create it with the following command :

Code:
VBoxManage createvdi -filename NameImage.vdi -size 2048 -static -type writethrough -register

But I still don't know, how to add a file into this vdi? Can someone help?
SmilieSmilieSmilie
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Bash script - Print an ascii file using specific font "Latin Modern Mono 12" "regular" "9"

Hello. System : opensuse leap 42.3 I have a bash script that build a text file. I would like the last command doing : print_cmd -o page-left=43 -o page-right=22 -o page-top=28 -o page-bottom=43 -o font=LatinModernMono12:regular:9 some_file.txt where : print_cmd ::= some printing... (1 Reply)
Discussion started by: jcdole
1 Replies

2. Shell Programming and Scripting

Creating "menus" for script

I have a script I'm working on. I needed to figure out a way to display the following information for our Linux servers: What application runs on the server (app), who owns the application (owner) and the hostname. This is done by looking at a text file "test_owner_list" that has info like... (2 Replies)
Discussion started by: lombardi4851
2 Replies

3. Homework & Coursework Questions

Need help creating shell script with output that has 2014 calendar and 2 text items from a"fortune"

Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted! 1. The problem statement, all variables and given/known data: I am required to create a bash shell script with either emacs or vi. It must include the year 2014 calendar on... (9 Replies)
Discussion started by: dandanhelpmeman
9 Replies

4. Fedora

Creating Windows 7 image to run in VirtualBox

Hey guys, Not sure if this is the best place for this question, but, after using Fedora now for about a year, I'm still getting used to it but I'm using it practically all the time now and instead of having a dual boot with Windows 7, I want to create an image of my Windows 7 installation,... (3 Replies)
Discussion started by: jimbob01
3 Replies

5. Shell Programming and Scripting

awk command to replace ";" with "|" and ""|" at diferent places in line of file

Hi, I have line in input file as below: 3G_CENTRAL;INDONESIA_(M)_TELKOMSEL;SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL My expected output for line in the file must be : "1-Radon1-cMOC_deg"|"LDIndex"|"3G_CENTRAL|INDONESIA_(M)_TELKOMSEL"|LAST|"SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL" Can someone... (7 Replies)
Discussion started by: shis100
7 Replies

6. Shell Programming and Scripting

Creating a Shortcut (to just type "l" but it runs "ls -lah")

How do I create shortcuts? For example: I just want to type one key "l" and have it output the command of "ls -lah" I believe it's creating a file called l with 755 permissions but I'm not sure where to put the file. *if it matters, I'm on a shared hosting web server using cPanel with... (2 Replies)
Discussion started by: ijustsawmars
2 Replies

7. Shell Programming and Scripting

Command Character size limit in the "sh" and "bourne" shell

Hi!!.. I would like to know what is maximum character size for a command in the "sh" or "bourne" shell? Thanks in advance.. Roshan. (1 Reply)
Discussion started by: Roshan1286
1 Replies

8. UNIX for Dummies Questions & Answers

Command Character size limit in the "sh" and "bourne" shell

Hi!!.. I would like to know what is maximum character size for a command in the "sh" or "bourne" shell? Thanks in advance.. Roshan. (1 Reply)
Discussion started by: Roshan1286
1 Replies

9. AIX

"too big" and "not enough memory" errors in shell script

Hi, This is odd, however here goes. There are several shell scripts that run in our production environment AIX 595 LPAR m/c, which has sufficient memory 14GB (physical memory) and horsepower 5CPUs. However from time to time we get the following errors in these shell scripts. The time when these... (11 Replies)
Discussion started by: jerardfjay
11 Replies

10. UNIX for Dummies Questions & Answers

No utpmx entry: you must exec "login" from lowest level "shell"

Hi I have installed solaris 10 on an intel machine. Logged in as root. In CDE, i open terminal session, type login alex (normal user account) and password and i get this message No utpmx entry: you must exec "login" from lowest level "shell" :confused: What i want is: open various... (0 Replies)
Discussion started by: peterpan
0 Replies
Login or Register to Ask a Question
QEMU-IMG(1)															       QEMU-IMG(1)

NAME
qemu-img - QEMU disk image utility SYNOPSIS
usage: qemu-img command [command options] OPTIONS
The following commands are supported: check [-f fmt] filename create [-s] [-f fmt] [-o options] filename [size] commit [-f fmt] filename convert [-c] [-s] [-f fmt] [-O output_fmt] [-o options] filename [filename2 [...]] output_filename info [-f fmt] filename snapshot [-l | -a snapshot | -c snapshot | -d snapshot] filename rebase [-u] -b backing_file [-F backing_fmt] filename Command parameters: filename is a disk image filename fmt is the disk image format. It is guessed automatically in most cases. See below for a description of the supported disk formats. size is the disk image size in bytes. Optional suffixes "k" or "K" (kilobyte, 1024) "M" (megabyte, 1024k) and "G" (gigabyte, 1024M) and T (terabyte, 1024G) are supported. "b" is ignored. output_filename is the destination disk image filename output_fmt is the destination format options is a comma separated list of format specific options in a name=value format. Use "-o ?" for an overview of the options supported by the used format or see the format descriptions below for details. -c indicates that target image must be compressed (qcow format only) -h with or without a command shows help and lists the supported formats Parameters to snapshot subcommand: snapshot is the name of the snapshot to create, apply or delete -a applies a snapshot (revert disk to saved state) -c creates a snapshot -d deletes a snapshot -l lists all snapshots in the given image Command description: create [-f fmt] [-o options] filename [size] Create the new disk image filename of size size and format fmt. Depending on the file format, you can add one or more options that enable additional features of this format. If the option backing_file is specified, then the image will record only the differences from backing_file. No size needs to be specified in this case. backing_file will never be modified unless you use the "commit" monitor command (or qemu-img commit). The size can also be specified using the size option with "-o", it doesn't need to be specified separately in this case. commit [-f fmt] filename Commit the changes recorded in filename in its base image. convert [-c] [-f fmt] [-O output_fmt] [-o options] filename [filename2 [...]] output_filename Convert the disk image filename to disk image output_filename using format output_fmt. It can be optionally compressed ("-c" option) or use any format specific options like encryption ("-o" option). Only the formats "qcow" and "qcow2" support compression. The compression is read-only. It means that if a compressed sector is rewritten, then it is rewritten as uncompressed data. Image conversion is also useful to get smaller image when using a growable format such as "qcow" or "cow": the empty sectors are detected and suppressed from the destination image. You can use the backing_file option to force the output image to be created as a copy on write image of the specified base image; the backing_file should have the same content as the input's base image, however the path, image format, etc may differ. info [-f fmt] filename Give information about the disk image filename. Use it in particular to know the size reserved on disk which can be different from the displayed size. If VM snapshots are stored in the disk image, they are displayed too. snapshot [-l | -a snapshot | -c snapshot | -d snapshot ] filename List, apply, create or delete snapshots in image filename. Supported image file formats: raw Raw disk image format (default). This format has the advantage of being simple and easily exportable to all other emulators. If your file system supports holes (for example in ext2 or ext3 on Linux or NTFS on Windows), then only the written sectors will reserve space. Use "qemu-img info" to know the real size used by the image or "ls -ls" on Unix/Linux. host_device Host device format. This format should be used instead of raw when converting to block devices or other devices where "holes" are not supported. qcow2 QEMU image format, the most versatile format. Use it to have smaller images (useful if your filesystem does not supports holes, for example on Windows), optional AES encryption, zlib based compression and support of multiple VM snapshots. Supported options: "backing_file" File name of a base image (see create subcommand) "backing_fmt" Image format of the base image "encryption" If this option is set to "on", the image is encrypted. Encryption uses the AES format which is very secure (128 bit keys). Use a long password (16 characters) to get maximum protection. "cluster_size" Changes the qcow2 cluster size (must be between 512 and 2M). Smaller cluster sizes can improve the image file size whereas larger cluster sizes generally provide better performance. "preallocation" Preallocation mode (allowed values: off, metadata). An image with preallocated metadata is initially larger but can improve performance when the image needs to grow. qcow Old QEMU image format. Left for compatibility. Supported options: "backing_file" File name of a base image (see create subcommand) "encryption" If this option is set to "on", the image is encrypted. cow User Mode Linux Copy On Write image format. Used to be the only growable image format in QEMU. It is supported only for compatibility with previous versions. It does not work on win32. vdi VirtualBox 1.1 compatible image format. vmdk VMware 3 and 4 compatible image format. Supported options: "backing_fmt" Image format of the base image "compat6" Create a VMDK version 6 image (instead of version 4) vpc VirtualPC compatible image format (VHD). cloop Linux Compressed Loop image, useful only to reuse directly compressed CD-ROM images present for example in the Knoppix CD-ROMs. SEE ALSO
The HTML documentation of QEMU for more precise information and Linux user mode emulator invocation. AUTHOR
Fabrice Bellard 2010-07-01 QEMU-IMG(1)