Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

virtual machine from USB stick (virt-manager & qemu/kvm)

5,569 views
Skip to first unread message

Eugene Zhukov

unread,
Jun 18, 2014, 4:00:02 AM6/18/14
to
Hello,

I'm trying to create a VM with Windows 7. Is there a way to do that from USB stick? It is a ~10GB corporate Windows package.

Thanks,
Eugene

P.S. Please CC me as I'm not subscribed to the list.

--
To UNSUBSCRIBE, email to debian-us...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listm...@lists.debian.org
Archive: https://lists.debian.org/BE690F6A-DA67-4FB3...@gmail.com

Darac Marjal

unread,
Jul 1, 2014, 5:20:01 AM7/1/14
to
[Resending, as this doesn't seem to have made it to the list]

On Wed, Jun 18, 2014 at 10:39:19AM +0300, Eugene Zhukov wrote:
> Hello,
>
> I'm trying to create a VM with Windows 7. Is there a way to do that from USB stick? It is a ~10GB corporate Windows package.

I presume the USB stick is your install medium? That is, you're not
trying to install TO the USB stick, but you're trying to install FROM
the USB stick TO a virtual machine on your hard drive.

In that case, when creating your VM in Virtual-Manager, add your target
device as Disk 1, then also add a USB Host Device, selecting the USB
stick as your device. Now, boot the virtual machine and install as if on
a real machine (i.e. following the installer's manual).
signature.asc

Eugene Zhukov

unread,
Jul 1, 2014, 6:40:01 AM7/1/14
to
On Tue, Jul 1, 2014 at 12:17 PM, Darac Marjal <maili...@darac.org.uk> wrote:
> [Resending, as this doesn't seem to have made it to the list]
>
> On Wed, Jun 18, 2014 at 10:39:19AM +0300, Eugene Zhukov wrote:
>> Hello,
>>
>> I'm trying to create a VM with Windows 7. Is there a way to do that from USB stick? It is a ~10GB corporate Windows package.
>
> I presume the USB stick is your install medium? That is, you're not
> trying to install TO the USB stick, but you're trying to install FROM
> the USB stick TO a virtual machine on your hard drive.
>
Correct.

> In that case, when creating your VM in Virtual-Manager, add your target
> device as Disk 1, then also add a USB Host Device, selecting the USB
> stick as your device. Now, boot the virtual machine and install as if on
> a real machine (i.e. following the installer's manual).
>
I'm using Virtual Machine Manager 0.9.5. When I'm going through create
new VM wizard it doesn't even have USB stick option, the only local
options are CDROM, DVDROM or ISO image.


--
To UNSUBSCRIBE, email to debian-us...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listm...@lists.debian.org
Archive: https://lists.debian.org/CAPqGMfLs0ek3NGJ4xwbvCOUyvCq=an_utLeApBt...@mail.gmail.com

Darac Marjal

unread,
Jul 1, 2014, 8:10:02 AM7/1/14
to
On Tue, Jul 01, 2014 at 01:19:06PM +0300, Eugene Zhukov wrote:
> On Tue, Jul 1, 2014 at 12:17 PM, Darac Marjal <maili...@darac.org.uk> wrote:
> > [Resending, as this doesn't seem to have made it to the list]
> >
> > On Wed, Jun 18, 2014 at 10:39:19AM +0300, Eugene Zhukov wrote:
> >> Hello,
> >>
> >> I'm trying to create a VM with Windows 7. Is there a way to do that from USB stick? It is a ~10GB corporate Windows package.
> >
> > I presume the USB stick is your install medium? That is, you're not
> > trying to install TO the USB stick, but you're trying to install FROM
> > the USB stick TO a virtual machine on your hard drive.
> >
> Correct.
>
> > In that case, when creating your VM in Virtual-Manager, add your target
> > device as Disk 1, then also add a USB Host Device, selecting the USB
> > stick as your device. Now, boot the virtual machine and install as if on
> > a real machine (i.e. following the installer's manual).
> >
> I'm using Virtual Machine Manager 0.9.5. When I'm going through create
> new VM wizard it doesn't even have USB stick option, the only local
> options are CDROM, DVDROM or ISO image.

Yes, I think you need to complete the wizard first. Probably the
simplest way to do that is to tell it you want to install from a local
CD (With no disc in the drive) or a non-existent ISO. When you complete
the wizard, the new VM will start (to begin the installation), power it
off and re-configure it to add the USB host.

signature.asc

Bob Weber

unread,
Jul 1, 2014, 11:30:02 AM7/1/14
to
On 07/01/2014 05:17 AM, Darac Marjal wrote:
> [Resending, as this doesn't seem to have made it to the list]
>
> On Wed, Jun 18, 2014 at 10:39:19AM +0300, Eugene Zhukov wrote:
>> Hello,
>>
>> I'm trying to create a VM with Windows 7. Is there a way to do that from USB stick? It is a ~10GB corporate Windows package.
If the USB stick is a disk image that can run as a self contained system (not an
install image) then copy the stick
to your hard disk with dd (dd if=/dev/sdx of=win7raw.img). Now in the "New VM"
wizard select "Import existing
disk image". In the last screen select "Customize configuration before
install". Then make sure the storage format is raw.
The system should boot from that drive now. Check the boot options to be sure
the correct drive is selected.

> I presume the USB stick is your install medium? That is, you're not
> trying to install TO the USB stick, but you're trying to install FROM
> the USB stick TO a virtual machine on your hard drive.
>
> In that case, when creating your VM in Virtual-Manager, add your target
> device as Disk 1, then also add a USB Host Device, selecting the USB
> stick as your device. Now, boot the virtual machine and install as if on
> a real machine (i.e. following the installer's manual).
>
>> Thanks,
>> Eugene
>>
>> P.S. Please CC me as I'm not subscribed to the list.
>>
>> --
>> To UNSUBSCRIBE, email to debian-us...@lists.debian.org
>> with a subject of "unsubscribe". Trouble? Contact listm...@lists.debian.org
>> Archive: https://lists.debian.org/BE690F6A-DA67-4FB3...@gmail.com
>>


--
To UNSUBSCRIBE, email to debian-us...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listm...@lists.debian.org
Archive: https://lists.debian.org/53B2D2AA...@gmail.com

Eugene Zhukov

unread,
Jul 2, 2014, 5:10:03 AM7/2/14
to
Darac Marjal <maili...@darac.org.uk> wrote:
[...]
> Yes, I think you need to complete the wizard first. Probably the
> simplest way to do that is to tell it you want to install from a local
> CD (With no disc in the drive) or a non-existent ISO. When you complete
> the wizard, the new VM will start (to begin the installation), power it
> off and re-configure it to add the USB host.

Thanks! I completed wizard as you said and then lsusb to find my stick, then

sudo kvm -m 2048 -smp 1 -drive file=/var/lib/libvirt/images/win.img \
-usb -usbdevice host:058f:6387 -boot menu=on

where /var/lib/libvirt/images/win.img is my empty VM created through
wizard and 058f:6387 is my stick.

Eugene


--
To UNSUBSCRIBE, email to debian-us...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listm...@lists.debian.org
Archive: https://lists.debian.org/CAPqGMfJgF_MDSrfcTHx3Hfgy...@mail.gmail.com
0 new messages