Re: [qubes-users] Problems with qvm-run --pass-io

2018-03-02 Thread Chris Laprise

On 03/02/2018 05:56 AM, Unman wrote:

On Fri, Mar 02, 2018 at 05:38:11AM -0500, Chris Laprise wrote:

On 03/02/2018 04:04 AM, donoban wrote:

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

On 03/02/2018 08:38 AM, Robert Walz wrote:

[robert@dom0 ~]$ qvm-run --pass-io tempDebian 'cat
"/home/user/meta.raw"' >
/var/lib/qubes/appvms/metasploitable/root.img I stopped the command
with Ctrl+C, because the root.img became bigger than the original
file's size. Then I got the following error messages.


Could you post:

[robert@dom0 ~]$ qvm-run --pass-io tempDebian 'ls -lsh
   "/home/user/meta.raw"'

Maybe your raw file is an sparse file. I'm not sure if cat would
handle it fine.



If source is sparse, you can also save it as sparse by piping through dd:

qvm-run --pass-io tempDebian 'cat "/home/user/meta.raw"' | dd conv=sparse
of=/var/lib/qubes/appvms/metasploitable/root.img




But that way you still cat the WHOLE file and then only resparse it after
the transfer. It will take significantly longer.


Yes, but there's no risk to dom0 with dd, as there is with parsing a 
guest-created tar file.


--

Chris Laprise, tas...@posteo.net
https://github.com/tasket
https://twitter.com/ttaskett
PGP: BEE2 20C5 356E 764A 73EB  4AB3 1DC4 D106 F07F 1886

--
You received this message because you are subscribed to the Google Groups 
"qubes-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to qubes-users+unsubscr...@googlegroups.com.
To post to this group, send email to qubes-users@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/qubes-users/e2a7c45a-92bc-4164-2510-c0134cfdda7f%40posteo.net.
For more options, visit https://groups.google.com/d/optout.


Re: [qubes-users] Problems with qvm-run --pass-io

2018-03-02 Thread Unman
On Fri, Mar 02, 2018 at 05:38:11AM -0500, Chris Laprise wrote:
> On 03/02/2018 04:04 AM, donoban wrote:
> > -BEGIN PGP SIGNED MESSAGE-
> > Hash: SHA256
> > 
> > On 03/02/2018 08:38 AM, Robert Walz wrote:
> > > [robert@dom0 ~]$ qvm-run --pass-io tempDebian 'cat
> > > "/home/user/meta.raw"' >
> > > /var/lib/qubes/appvms/metasploitable/root.img I stopped the command
> > > with Ctrl+C, because the root.img became bigger than the original
> > > file's size. Then I got the following error messages.
> > 
> > Could you post:
> > 
> > [robert@dom0 ~]$ qvm-run --pass-io tempDebian 'ls -lsh
> >   "/home/user/meta.raw"'
> > 
> > Maybe your raw file is an sparse file. I'm not sure if cat would
> > handle it fine.
> 
> 
> If source is sparse, you can also save it as sparse by piping through dd:
> 
> qvm-run --pass-io tempDebian 'cat "/home/user/meta.raw"' | dd conv=sparse
> of=/var/lib/qubes/appvms/metasploitable/root.img
> 
> 

But that way you still cat the WHOLE file and then only resparse it after
the transfer. It will take significantly longer.

-- 
You received this message because you are subscribed to the Google Groups 
"qubes-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to qubes-users+unsubscr...@googlegroups.com.
To post to this group, send email to qubes-users@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/qubes-users/20180302105643.eqhk2rbgyoqqizbq%40thirdeyesecurity.org.
For more options, visit https://groups.google.com/d/optout.


Re: [qubes-users] Problems with qvm-run --pass-io

2018-03-02 Thread Chris Laprise

On 03/02/2018 04:04 AM, donoban wrote:

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

On 03/02/2018 08:38 AM, Robert Walz wrote:

[robert@dom0 ~]$ qvm-run --pass-io tempDebian 'cat
"/home/user/meta.raw"' >
/var/lib/qubes/appvms/metasploitable/root.img I stopped the command
with Ctrl+C, because the root.img became bigger than the original
file's size. Then I got the following error messages.


Could you post:

[robert@dom0 ~]$ qvm-run --pass-io tempDebian 'ls -lsh
  "/home/user/meta.raw"'

Maybe your raw file is an sparse file. I'm not sure if cat would
handle it fine.



If source is sparse, you can also save it as sparse by piping through dd:

qvm-run --pass-io tempDebian 'cat "/home/user/meta.raw"' | dd 
conv=sparse of=/var/lib/qubes/appvms/metasploitable/root.img



--

Chris Laprise, tas...@posteo.net
https://github.com/tasket
https://twitter.com/ttaskett
PGP: BEE2 20C5 356E 764A 73EB  4AB3 1DC4 D106 F07F 1886

--
You received this message because you are subscribed to the Google Groups 
"qubes-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to qubes-users+unsubscr...@googlegroups.com.
To post to this group, send email to qubes-users@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/qubes-users/6a92dc2f-a37c-6544-75e7-97f8e35795a4%40posteo.net.
For more options, visit https://groups.google.com/d/optout.


Re: [qubes-users] Problems with qvm-run --pass-io

2018-03-02 Thread Unman
On Fri, Mar 02, 2018 at 10:04:53AM +0100, donoban wrote:
> -BEGIN PGP SIGNED MESSAGE-
> Hash: SHA256
> 
> On 03/02/2018 08:38 AM, Robert Walz wrote:
> > [robert@dom0 ~]$ qvm-run --pass-io tempDebian 'cat 
> > "/home/user/meta.raw"' >
> > /var/lib/qubes/appvms/metasploitable/root.img I stopped the command
> > with Ctrl+C, because the root.img became bigger than the original
> > file's size. Then I got the following error messages.
> 
> Could you post:
> 
> [robert@dom0 ~]$ qvm-run --pass-io tempDebian 'ls -lsh
>  "/home/user/meta.raw"'
> 
> Maybe your raw file is an sparse file. I'm not sure if cat would
> handle it fine.

I think you're right.
cat will churn the whole file, you need some alternative that is sparse
aware.
The best approach would be:
qvm-run --pass-io tempDebian 'tar -Scf - /home/user/meta.raw' > meta.tar
and then untar the resulting file
Almost anything else (dd, rsync etc) will have some overhead in my
experience.

-- 
You received this message because you are subscribed to the Google Groups 
"qubes-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to qubes-users+unsubscr...@googlegroups.com.
To post to this group, send email to qubes-users@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/qubes-users/20180302101438.6iin6nqv6oq46gmw%40thirdeyesecurity.org.
For more options, visit https://groups.google.com/d/optout.


Re: [qubes-users] Problems with qvm-run --pass-io

2018-03-02 Thread donoban
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

On 03/02/2018 08:38 AM, Robert Walz wrote:
> [robert@dom0 ~]$ qvm-run --pass-io tempDebian 'cat 
> "/home/user/meta.raw"' >
> /var/lib/qubes/appvms/metasploitable/root.img I stopped the command
> with Ctrl+C, because the root.img became bigger than the original
> file's size. Then I got the following error messages.

Could you post:

[robert@dom0 ~]$ qvm-run --pass-io tempDebian 'ls -lsh
 "/home/user/meta.raw"'

Maybe your raw file is an sparse file. I'm not sure if cat would
handle it fine.
-BEGIN PGP SIGNATURE-

iQIzBAEBCAAdFiEEznLCgPSfWTT+LPrmFBMQ2OPtCKUFAlqZE7MACgkQFBMQ2OPt
CKV38g/8CLzOQ1j/mA5SclMy8u4XiOiB8WFTN+SID7dJl2P3PvX8hUQ7gv9vHjS6
SyuBsKRBIOgG6G102oizvc/5qYTU0u97iJ6j0b1uJKDJhadJbhbuDt2rx+d5X3CI
AfFarelpiGjZHPIUZqYAmZeezvwV7wAvm3lwIBJm08Am3NYjIUhDQ/Tm1G2siN0B
PgLjh3+FZEJjJ58cb0x9r08Y+xOFF1pOXYxiGmvRu1hC/kK+s3QRq/jlm7tbdiXE
2EDjVVxX7eNScMfmjs4w9QGa9Ez+Bfp/F0Yt7p6Gqvs3ELhgIL6g/udraZijUQlO
X7NuON20bodrzfKtARYY6EMoi+zKp2Hv5x5v9gtnUgLUOtJkZVm+nuhGgyXbWDDq
UJAb23GGfMh+vXmtgl7zFxrgeX5gV90+C0WzwL6hyKMRMPyoA1prmkJM4DVfgIWX
NjdPCupxgspq9QIIIs9yTwzVZLeswm1CPu2XA4aFCUh5/l5gppahjkmaWO5PECj5
MHmTLh+pVBveMd6VDEa88zAY0qiIvfEyGhOS4y9dps8foYucQC3ojDJ/iXH4KWVq
uzibhzMOtLtgvet9xCifciERtghArITkNvdlYLTC5tisqtrHA0byqgo1sKUkDqrK
YbeSLyp8GTQ3mN+lcYXJ5HsEdJZtzxdYqve1IfopQsU7Z1LNurk=
=oLBE
-END PGP SIGNATURE-

-- 
You received this message because you are subscribed to the Google Groups 
"qubes-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to qubes-users+unsubscr...@googlegroups.com.
To post to this group, send email to qubes-users@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/qubes-users/9f34e13f-1a60-670a-8105-e8b930a446bd%40riseup.net.
For more options, visit https://groups.google.com/d/optout.


[qubes-users] Problems with qvm-run --pass-io

2018-03-01 Thread Robert Walz
Hi,

I tried to copy a raw image for a metasploitable vm to dom0, but it doesn't
work.

I followed the instructions on https://www.qubes-os.org/doc/
hvm/#converting-virtualbox-vm-to-hvm to create the raw image, then I tried
to copy it to dom0:

[robert@dom0 ~]$ qvm-run --pass-io tempDebian 'cat "/home/user/meta.raw"' >
> /var/lib/qubes/appvms/metasploitable/root.img
>

I stopped the command with Ctrl+C, because the root.img became bigger than
the original file's size.
Then I got the following error messages.


CTraceback (most recent call last):
>   File "/usr/bin/qvm-run", line 222, in 
> main()
>   File "/usr/bin/qvm-run", line 217, in main
> r = vm_run_cmd(vm, cmdstr, options)
>   File "/usr/bin/qvm-run", line 66, in vm_run_cmd
> gui = options.gui, filter_esc = options.filter_esc)
>   File "/usr/lib64/python2.7/site-packages/qubes/modules/000QubesVm.py",
> line 1689, in run
> retcode = subprocess.call(args, **call_kwargs)
>   File "/usr/lib64/python2.7/subprocess.py", line 522, in call
> return Popen(*popenargs, **kwargs).wait()
>   File "/usr/lib64/python2.7/subprocess.py", line 1384, in wait
> pid, sts = _eintr_retry_call(os.waitpid, self.pid, 0)
>   File "/usr/lib64/python2.7/subprocess.py", line 476, in
> _eintr_retry_call
> return func(*args)
> KeyboardInterrupt
> [robert@dom0 ~]$
>

Does anybody know what this means, or what went wrong?

Thank you in advance.

Robert

-- 
You received this message because you are subscribed to the Google Groups 
"qubes-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to qubes-users+unsubscr...@googlegroups.com.
To post to this group, send email to qubes-users@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/qubes-users/CA%2B%3DSG9T4QcKoQa8EDbxZVRoU-zkQr8fCsDxR7J7XmYqf7g-uww%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.