virt-p2v-make-disk(1)

πŸ’… virt-p2v-make-disk β€” like, the manual page, but make it make sense

okay so bestie, this is the virt-p2v-make-disk(1) page from the Virtualization Support section of the manual. It's a whole vibe, and honestly? It's the tool that builds you a cute little bootable virt-p2v disk. Let's get into it ✨


🌸 NAME 🌸

virt-p2v-make-disk β€” literally builds the virt-p2v disk, using virt-builder


✨ SYNOPSIS ✨

virt-p2v-make-disk -o /dev/sdX [os-version]

πŸ’– DESCRIPTION πŸ’–

So virt-p2v(1) is the icon that converts a physical machine into a virtualized one running on KVM, managed by libvirt, OpenStack, oVirt, Red Hat Enterprise Virtualisation (RHEV), or any of the other targets that virt-v2v(1) supports. main character energy fr fr.

And virt-p2v-make-disk? It's the script that creates a bootable disk image or USB key containing virt-p2v. It uses virt-builder(1) to do it, and ngl it's just a small shell script wrapped around virt-builder. lowkey adorable.

The required -o parameter is where you say the output should go, like to a USB key (eg. -o /dev/sdX) or to a file. ⚠️ and if you pass a device name, the existing contents of that device get erased, so like… be so careful bestie.

The root user on the disk image uses p2v as its initial password. iykyk πŸ”‘

πŸŽ€ the os-version parameter πŸŽ€

The optional os-version parameter is the base Linux distro to use for the operating system on the ISO. If you don't set it, the script tries to pick a suitable default for you. Most users should not use the os-version parameter β€” it's giving "leave it to the professionals" πŸ’…

Heads up: the base OS you pick for virt-p2v is not related in any way to the OS of the physical machine you're trying to convert. They're strangers, they don't know each other.

To list possible os-version combinations, do this:

virt-builder -l

🌈 EXAMPLES 🌈

Write a virt-p2v bootable USB key on /dev/sdX (any existing content on /dev/sdX is erased β€” no cap, it's gone):

virt-p2v-make-disk -o /dev/sdX

Write a virt-p2v bootable virtual disk image, and boot it under qemu:

virt-p2v-make-disk -o /var/tmp/p2v.img
qemu-kvm -m 1024 -boot c \
  -drive file=/var/tmp/p2v.img,if=virtio,index=0 \
  -drive file=/var/tmp/guest.img,if=virtio,index=1

where /var/tmp/guest.img would be the disk image of some guest that you want to convert (for testing only β€” testing era only πŸ§ͺ).


πŸ¦‹ ADDING EXTRA PACKAGES πŸ¦‹

You can install extra packages using the --install option. This is lowkey useful for making a more fully-featured virt-p2v disk with extra tools for debugging and troubleshooting. Give a list of packages, separated by commas. Like so:

virt-p2v-make-disk -o /var/tmp/p2v.img --install tcpdump,traceroute

πŸ” ADDING AN SSH IDENTITY πŸ”

You can inject an SSH identity (private key) file to the image using the --inject-ssh-identity option. slay.

First create a key pair. It must have an empty passphrase:

ssh-keygen -t rsa -N '' -f id_rsa

This creates a private key (id_rsa) and a public key (id_rsa.pub) pair. The public key should be appended to the authorized_keys file on the virt-v2v conversion server (usually to /root/.ssh/authorized_keys).

The private key should be injected into the disk image and then discarded β€” truly the "you don't need him girl" of key management:

virt-p2v-make-disk [...] --inject-ssh-identity id_rsa
rm id_rsa

When booting virt-p2v, specify the URL of the injected file like this:

β”‚         User name: [root_____________________________] β”‚
β”‚                                                        β”‚
β”‚          Password: [    <leave this field blank>     ] β”‚
β”‚                                                        β”‚
β”‚  SSH Identity URL: [file:///var/tmp/id_rsa___________] β”‚

or if you're using the kernel command line, add:

p2v.identity=file:///var/tmp/id_rsa

For more info, see SSH IDENTITIES in virt-p2v(1). 🫢


⭐ 32 BIT VIRT-P2V ⭐

For improved compatibility with older hardware, virt-p2v-make-disk has an --arch option. The most useful setting (on x86-64 hosts) is --arch i686, which builds a 32 bit virt-p2v environment that will work on older hardware. And the plot twist? 32 bit virt-p2v can convert 64 bit physical machines and can interoperate with 64 bit virt-v2v and 64 bit hypervisors. ate and left no crumbs.

This option requires that you have built virt-p2v.$arch (ie. usually virt-p2v.i686) by some means, and that you install it next to the ordinary virt-p2v binary (eg. in $libdir/virt-p2v/ or $VIRT_V2V_DATA_DIR). That's outside the scope of this manual page, but you can find some tips in BUILDING i686 32 BIT VIRT-P2V in p2v-building(1).


πŸ’… OPTIONS πŸ’…

  • --help β€” Display help. that's it, that's the whole vibe.
  • --arch ARCH β€” Set the architecture of the virt-p2v ISO. See 32 BIT VIRT-P2V above. If this option is not supplied, then the default is to use the same architecture as the host that is running virt-p2v-make-disk.
  • --inject-ssh-identity id_rsa β€” Add an SSH identity (private key) file into the image. See ADDING AN SSH IDENTITY above.
  • --install pkg,pkg,... β€” Add extra packages to the image. See ADDING EXTRA PACKAGES above.
  • --no-warn-if-partition β€” Normally you should not write to a partition on a USB drive (ie. don't use -o /dev/sdX1, use -o /dev/sdX to make a bootable USB drive). If you do this, virt-builder prints a warning. This option suppresses that warning. πŸ™ˆ
  • -o OUTPUT, --output OUTPUT β€” Write output to OUTPUT, which can be a local file or block device. ⚠️ The existing contents of the device will be erased.
  • -v, --verbose β€” Enable verbose output. Use this if you need to debug problems with the script or if you are filing a bug. detective era πŸ”
  • -V, --version β€” Display version number and exit.

πŸŽ€ FILES πŸŽ€

  • $libdir/virt-p2v/virt-p2v.xz β€” The virt-p2v(1) binary which is copied into the bootable disk image. The location of the binary can be changed by setting the VIRT_P2V_DATA_DIR environment variable.
  • $datadir/virt-p2v/issue, $datadir/virt-p2v/launch-virt-p2v.in, $datadir/virt-p2v/p2v.service β€” Various data files that are copied into the bootable disk image. The location of these files can be changed by setting the VIRT_P2V_DATA_DIR environment variable.

🌸 ENVIRONMENT VARIABLES 🌸

  • VIRT_P2V_DATA_DIR β€” The directory where virt-p2v-make-disk looks for data files (see FILES above). If not set, a compiled-in location is used.

πŸ‘‘ SEE ALSO πŸ‘‘

virt-p2v(1), virt-p2v-make-kickstart(1), virt-p2v-make-kiwi(1), virt-v2v(1), http://libguestfs.org/.


🫢 AUTHORS 🫢

Richard W.M. Jones http://people.redhat.com/~rjones/


Copyright (C) 2009-2019 Red Hat Inc.


πŸ“œ LICENSE πŸ“œ

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see <https://www.gnu.org/licenses/>.


πŸ’€ BUGS πŸ’€

To get a list of bugs against libguestfs (which include virt-p2v), use this link: https://bugzilla.redhat.com/buglist.cgi?component=libguestfs&product=Virtualization+Tools

To report a new bug against libguestfs, use this link: https://bugzilla.redhat.com/enter_bug.cgi?component=libguestfs&product=Virtualization+Tools

When reporting a bug, please supply:

  • The version of virt-p2v.
  • Where you got virt-p2v (eg. which Linux distro, compiled from source, etc)
  • Describe the bug accurately and give a way to reproduce it.

okay that's the whole page bestie, hope it slayed πŸ’– this was virt-p2v-1.42.4, dated 2024-11-05, and that's the virt-p2v-make-disk(1) manual page β€” periodt. πŸŽ€βœ¨

πŸ“¦ where this page comes from