Skip to content

Instantly share code, notes, and snippets.

@DownGoat
Created March 25, 2018 09:51
Show Gist options
  • Save DownGoat/f91b987df5701fb920c87124ae547a4a to your computer and use it in GitHub Desktop.
Save DownGoat/f91b987df5701fb920c87124ae547a4a to your computer and use it in GitHub Desktop.
pyvbox -virtualbox api copy fil to guest
import virtualbox
from virtualbox.library import FileCopyFlag
VM_NAME = 'w7-32bit-1'
vbox = virtualbox.VirtualBox()
vm = vbox.find_machine(VM_NAME)
session = vm.create_session()
gs = session.console.guest.create_session("kokoa", '')
"""
http://pythonhosted.org/pyvbox/virtualbox/library.html?highlight=process_create#virtualbox.library.IGuestSession.file_copy_to_guest
See for FileCopyFlags http://pythonhosted.org/pyvbox/virtualbox/library.html?highlight=process_create#virtualbox.library.FileCopyFlag
"""
gs.file_copy_to_guest("/path/to/file/host", "C:\\PATH\\GUEST\\DESTINATION\\FILE", [FileCopyFlag(0)])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment