Commands tagged qemu (3)

  • Converts a .vdi file to a .vmdk file for use in a vmware virtual machine. The benefit: using this method actually works. There are others out there that claim to give you a working .vmdk by simply using the qemu-img command alone. Doing that only results in pain for you because the .vmdk file will be created with no errors, but it won't boot either. Be advised that these conversions are very disk-intensive by nature; you are probably dealing with disk images several gigabytes in size. Once finished, the process of using the new .vmdk file is left as an exercise to the reader. Show Sample Output

    VBoxManage internalcommands converttoraw winxp.vdi winxp.raw && qemu-img convert -O vmdk winxp.raw winxp.vmdk && rm winxp.raw
    linuxrawkstar · 2009-10-12 16:23:37 0
  • Unlock your VMS to avoid problems after some failed tasks ended. Show Sample Output

    for i in $(qm list | awk '{ print $1 }' | grep -v VMID); do echo "Unlocking:" $i; qm unlock $i; echo "Unlocked"; done
    arkalira · 2018-09-13 08:35:12 0
  • This is based on the Windows Version of VirtualBox. From the /? ... VBoxManage clonehd | [--format VDI|VMDK|VHD|RAW|] [--variant Standard,Fixed,Split2G,Stream,ESX] [--type normal|writethrough|immutable|shareable] [--remember] [--existing] From the online help.. VBoxManage clonehd This command duplicates a registered virtual hard disk image to a new image file with a new unique identifier (UUID). The new image can be transferred to another host system or imported into VirtualBox again using the Virtual Media Manager; see the section called ?The Virtual Media Manager? and the section called ?Cloning disk images?. The syntax is as follows: VBoxManage clonehd | [--format VDI|VMDK|VHD|RAW|] [--variant Standard,Fixed,Split2G,Stream,ESX] [--type normal|writethrough|immutable] [--remember] where the parameters mean: format Allow to choose a file format for the output file different from the file format of the input file. variant Allow to choose a file format variant for the output file. It is a comma-separated list of variant flags. Not all combinations are supported, and specifying inconsistent flags will result in an error message. type Only honored if --remember is also specified. Defines what kind of hard disk type this image should be. remember Keep the destination image registered after it was successfully written. Show Sample Output

    vboxmanage clonehd --format VMDK <source image|uuid> <destination image>
    dreffed · 2010-10-04 16:42:12 0

What's this? is the place to record those command-line gems that you return to again and again. That way others can gain from your CLI wisdom and you from theirs too. All commands can be commented on, discussed and voted up or down.

Share Your Commands

Check These Out

Play online music videos in terminal
pvl 'link1' 'link2' 'link3' Play Youtube, Vimeo, etc links without visual elements. Great for music videos when you just want the audio. You can control mplayer with this! Hit Ctrl-C twice to exit (if you're playing multiple files)

The Chronic: run a command every N seconds in the background
Chronic Bash function: $ chronic 3600 time # Print the time in your shell every hour $ chronic 60 updatedb > /dev/null # update slocate every minute Note: use 'jobs' to list background tasks and fg/bg to take control of them.

Which processes are listening on a specific port (e.g. port 80)
swap out "80" for your port of interest. Can use port number or named ports e.g. "http"

identify exported sonames in a path
This provides a list of shared object names (sonames) that are exported by a given tree. This is usually useful to make sure that a given required dependency (NEEDED entry) is present in a firmware image tree. The shorter (usable) version for it would be $ scanelf -RBSq -F "+S#f" But I used the verbose parameters in the command above, for explanation.

List the size (in human readable form) of all sub folders from the current location

Alert visually until any key is pressed
I learned a few things reading this command. But I did run into a few issues: 1. On systems that don't use GNU echo (e.g. macOS 10.14.5 Mojave), the e option may not be supported. In this case ANSI escape codes will echoed as text and the terminal will not flash, like this: \e[?5h\e[38;5;1m A L E R T Thu Jun 20 16:31:29 PDT 2019 2. Since the read command strips\ignores leading backslashes, if a user types the backslash character once in the loop, it will not break. Typing backslash twice in a loop will break as expected. 3. The foreground color is set to red (\e[38;5;1m) on every loop. This could be set once before we call while, and then reset once when the loop breaks. 4. Instead of resetting the foreground color when it breaks, the video mode is set back to normal (\e[?5l). This has the effect of leaving the terminal text red until it is manually reset. The alternative I'm proposing here addresses these issues. I tested it on macOS and Arch Linux.

Unix time to local time

download all the presentations from UTOSC2010
miss a class at UTOSC2010? need a refresher? use this to curl down all the presentations from the UTOSC website. ( NOTE/WARNING this will dump them in the current directory and there are around 37 and some are big - tested on OSX10.6.1

Insert a line at the top of a text file without sed or awk or bash loops
Just use '-' to use STDIN as an additional input to 'cat'

prevent accidents while using wildcards
alternative for "echo rm *.txt". Just doubletab the command you are willing to use and it will show you the affected files.

Stay in the loop…

Follow the Tweets.

Every new command is wrapped in a tweet and posted to Twitter. Following the stream is a great way of staying abreast of the latest commands. For the more discerning, there are Twitter accounts for commands that get a minimum of 3 and 10 votes - that way only the great commands get tweeted.


Subscribe to the feeds.

Use your favourite RSS aggregator to stay in touch with the latest commands. There are feeds mirroring the 3 Twitter streams as well as for virtually every other subset (users, tags, functions,…):

Subscribe to the feed for: