VirtualBox

Opened 22 months ago

#21782 new defect

error when I copy file between host and guest using API virtualbox.library.IGuestSession.file_copy_from_guest

Reported by: raarvir Owned by:
Component: guest control Version: VirtualBox-7.0.8
Keywords: API python winxp Cc:
Guest type: Windows Host type: Windows

Description

Specs

Host Machine: Intel(R) Core(TM) i5-6267U CPU @ 2.90GHz 8GB x86-64

Host OS: Windows 10 Pro for Workstations, Ver. 22H2, OS Build 19045.3208 x86-64

Guest OS: Windows XP 2002 Service Pack 3, OS Release: 5.1.2600 x86

VBOX version: VBoxService 7.0.8 r156879 (verbosity: 0) win.x86 (Apr 17 2023 17:42:44)

API version: pyvbox 2.1.1

Guest Addition: VirtualBox Guest Device: 7.0.8.6879 / VirtualBox Graphics Adapter: 4.1.4.0 (because 7.x version causes black screen)

IDE Primary Device 0: VMChnWinXP.vdi (Normal, Encrypted, 50.00 GB)

Memory: 1024 MB

Acceleration: Nested Paging

Execution:

import virtualbox from virtualbox import library vbox = virtualbox.VirtualBox() session = virtualbox.Session() machine = vbox.find_machine("VMChnWinXP")

progress = machine.launch_vm_process(session, "gui", []) progress.wait_for_completion()

session.type_p

SessionType(3)

machine.state

MachineState(6)

guest_session = session.console.guest.create_session("Administrator", "changeme")

guest_session.file_copy_from_guest('C:\WorkingDir\Projects\simple_proj\simple_proj\reko3_memory.cpp', 'C:\WorkingDir\cpp_source_file_guest\reko3_memory.cpp', [library.FileCopyFlag(0)])

<virtualbox.library_ext.progress.IProgress at 0x20027229220>

##### no error shown for the above command, but file was not copied #####

guest_session.file_exists('C:\WorkingDir\Projects\simple_proj\simple_proj\reko3_memory.cpp', False)

##### error output from python when I check existence of file in DEST ##### com_error Traceback (most recent call last) File ~\anaconda3\envs\reko3ibm\lib\site-packages\virtualbox\library_base.py:209, in Interface._call_method(self, method, in_p)

208 try:

--> 209 ret = method(*in_params)

210 except Exception as exc:

File ~\AppData\Local\Temp\gen_py\3.8\D7569351-1750-46F0-936E-BD127D5BC264x0x1x3.py:6567, in IGuestSession.FileExists(self, aPath, aFollowSymlinks)

6566 def FileExists(self, aPath=defaultNamedNotOptArg, aFollowSymlinks=defaultNamedNotOptArg):

-> 6567 return self._oleobj_.InvokeTypes(1610743860, LCID, 1, (3, 0), ((8, 1), (3, 1)),aPath

6568 , aFollowSymlinks)

com_error: (-2147352567, 'Exception occurred.', (0, 'GuestSessionWrap', 'Querying guest file existence failed: Unhandled error VERR_GENERAL_FAILURE for "C:
WorkingDir
Projects
simple_proj
simple_proj\reko3_memory.cpp" occurred for tool "vbox_stat" on guest -- please file a bug report', None, 0, -2135228411), None)

During handling of the above exception, another exception occurred:

VBoxError Traceback (most recent call last) Cell In[882], line 1


File ~\anaconda3\envs\reko3ibm\lib\site-packages\virtualbox\library_ext\guest_session.py:127, in IGuestSession.file_exists(self, path, follow_symlinks)

126 def file_exists(self, path, follow_symlinks=True):

--> 127 return super(IGuestSession, self).file_exists(path, follow_symlinks)

File ~\anaconda3\envs\reko3ibm\lib\site-packages\virtualbox\library.py:22919, in IGuestSession.file_exists(self, path, follow_symlinks)

22917 if not isinstance(follow_symlinks, bool): 22918 raise TypeError("follow_symlinks can only be an instance of type bool")

22919 exists = self._call("fileExists", in_p=[path, follow_symlinks])

22920 return exists

File ~\anaconda3\envs\reko3ibm\lib\site-packages\virtualbox\library_base.py:200, in Interface._call(self, name, in_p)

198 method = self._search_attr(name) 199 if inspect.isfunction(method) or inspect.ismethod(method):

--> 200 return self._call_method(method, in_p=in_p)

201 else: 202 return method

File ~\anaconda3\envs\reko3ibm\lib\site-packages\virtualbox\library_base.py:228, in Interface._call_method(self, method, in_p)

226 default_msg = getattr(exc, "message", str(exc)) 227 errobj.msg = getattr(exc, "msg", default_msg)

--> 228 raise errobj

229 return ret

eko3_memory.cpp" occurred for tool "vbox_stat" on guest -- please file a bug report)ror VERR_GENERAL_FAILURE for "C:\WorkingDir\Projects\simple_proj\simple_proj

##### Error log in VBOX.log ##### 04:04:45.853831 VMMDev: Guest Log: 21:28:43.050110 main VbglR3GuestCtrlProcGetStart: Retrieving 04:04:45.853976 VMMDev: Guest Log: 21:28:43.050110 main VbglR3GuestCtrlProcGetStart: Returning VINF_SUCCESS (retry 0, cbCmd=1024, cbArgs=1024, cbEnv=0) 04:04:45.871662 ERROR [COM]: aRC=VBOX_E_IPRT_ERROR (0x80bb0005) aIID={234f0627-866d-48c2-91a5-4c9d50f04928} aComponent={GuestSessionWrap} aText={Querying guest file existence failed: Unhandled error VERR_GENERAL_FAILURE for "C:\WorkingDir\Projects\simple_proj\simple_proj eko3_memory.cpp" occurred for tool "vbox_stat" on guest -- please file a bug report}, preserve=false aResultDetail=-1

##### another error I noticed but may not be relevant #####

[m.name for m in vbox.machines]

com_error Traceback (most recent call last) Cell In[870], line 1


Cell In[870], line 1, in <listcomp>(.0)


File ~\anaconda3\envs\reko3ibm\lib\site-packages\virtualbox\library.py:14147, in IMachine.name(self)

14108 @property 14109 def name(self): 14110 """Get or set str value for 'name' 14111 Name of the virtual machine. 14112

(...)

14145 used a generic ".xml" extension.) 14146 """

14147 ret = self._get_attr("name")

14148 return ret

File ~\anaconda3\envs\reko3ibm\lib\site-packages\virtualbox\library_base.py:179, in Interface._get_attr(self, name)

178 def _get_attr(self, name):

--> 179 attr = self._search_attr(name, prefix="get")

180 if inspect.isfunction(attr) or inspect.ismethod(attr): 181 return self._call_method(attr)

File ~\anaconda3\envs\reko3ibm\lib\site-packages\virtualbox\library_base.py:166, in Interface._search_attr(self, name, prefix)

164 for i in range(3): 165 for attr_name in attr_names:

--> 166 attr = getattr(self._i, attr_name, self)

167 if attr is not self: 168 break

File ~\anaconda3\envs\reko3ibm\lib\site-packages\vboxapi-1.0-py3.8.egg\vboxapi\init__.py:195, in _CustomGetAttr(self, sAttr)

193 # Slow path. 194 try:

--> 195 return _g_dCOMForwardgetattr(self, ComifyName(sAttr))

196 except AttributeError: 197 return _g_dCOMForwardgetattr(self, sAttr)

File ~\anaconda3\envs\reko3ibm\lib\site-packages\win32com\client\init__.py:583, in DispatchBaseClass.getattr(self, attr)

579 if args is None: 580 raise AttributeError( 581 "'%s' object has no attribute '%s'" % (repr(self), attr) 582 )

--> 583 return self._ApplyTypes_(*args)

File ~\anaconda3\envs\reko3ibm\lib\site-packages\win32com\client\init__.py:572, in DispatchBaseClass._ApplyTypes_(self, dispid, wFlags, retType, argTypes, user, resultCLSID, *args)

570 def _ApplyTypes_(self, dispid, wFlags, retType, argTypes, user, resultCLSID, *args): 571 return self._get_good_object_(

--> 572 self._oleobj_.InvokeTypes(dispid, 0, wFlags, retType, argTypes, *args),

573 user, 574 resultCLSID, 575 )

com_error: (-2147352567, 'Exception occurred.', (0, 'MachineWrap', 'The object functionality is limited', None, 0, -2147024891), None)

Description: when I try to use API to copy file it throws error, if I use File Manager graphical interface to copy file it works very well.

Many thanks!

Change History (0)

Note: See TracTickets for help on using tickets.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette