You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Getting following error while connecting to Guest OS: Client received SOAP Fault from server: Permission to perform this operation was denied. Please see the server log to find more detail regarding exact cause of the failure
#77
Open
1 of 3 tasks
LakshmanPatil opened this issue
Aug 22, 2019
· 1 comment
String[] opts = new String[]{"guest.guestOperationsReady"};
String[] opt = new String[]{"guest.guestOperationsReady"};
wV.wait(ob, opts, opt,new Object[][]{{true}});
Map<String, ManagedObjectReference> var1 = VimUtil.inFolderByType(vimPort,serviceContent,serviceContent.getRootFolder(), "VirtualMachine");
ManagedObjectReference var2 = (ManagedObjectReference)var1.get(vmName);
if (var2 != null) {
System.out.println("Virtual Machine " + vmName + " found");
System.out.println("Guest Operations are ready for the VM");
ManagedObjectReference guestOpManger =
serviceContent.getGuestOperationsManager();
ManagedObjectReference fileManagerRef =
(ManagedObjectReference) VimUtil.entityProps(vimPort,serviceContent,guestOpManger,
new String[]{"fileManager"}).get("fileManager");
System.out.println(fileManagerRef);
System.out.println(fileManagerRef.getType());
System.out.println(fileManagerRef.getValue());
NamePasswordAuthentication auth = new NamePasswordAuthentication();
auth.setUsername("username");
auth.setPassword("password");
auth.setInteractiveSession(false);
vimPort.validateCredentialsInGuest(fileManagerRef, var2, auth);
System.out.println("validation for guest Credentials");
List li=new ArrayList<>();
li.add("open notepad.exe");
System.out.println("Executing CreateTemporaryFile guest operation");
System.out.println("FileInitailization"+vimPort.initiateFileTransferFromGuest(fileManagerRef, var2, auth, "C:\Users\"));
vimPort.createFolder(fileManagerRef, "C:\Users\Public\dsfsfs");
String result =
vimPort.createTemporaryFileInGuest(fileManagerRef, var2, auth,"TestAfter", "BeforeTest", "C:\Users\Public");
System.out.println("Temporary file was successfully created at: "
+ result + " inside the guest");
Actual behavior
Unable to login to Guest OS and not fetching any files
Expected behavior
Login to Guest OS should happen, file directory inside Guest os should be available to perform read and write operation.
Note: I am not sure that the methods i am trying is the correct one. Please help me with correct one. Even I am not able to fetch the ip address of the VM using sdk.
The text was updated successfully, but these errors were encountered:
Description
Environment
SDK version:
6.7.0
Java version:
1.8
vSphere version:
6.7.0
Steps or code snippet to reproduce
String[] opts = new String[]{"guest.guestOperationsReady"};
String[] opt = new String[]{"guest.guestOperationsReady"};
wV.wait(ob, opts, opt,new Object[][]{{true}});
Map<String, ManagedObjectReference> var1 = VimUtil.inFolderByType(vimPort,serviceContent,serviceContent.getRootFolder(), "VirtualMachine");
ManagedObjectReference var2 = (ManagedObjectReference)var1.get(vmName);
if (var2 != null) {
System.out.println("Virtual Machine " + vmName + " found");
System.out.println("Guest Operations are ready for the VM");
ManagedObjectReference guestOpManger =
serviceContent.getGuestOperationsManager();
ManagedObjectReference fileManagerRef =
(ManagedObjectReference) VimUtil.entityProps(vimPort,serviceContent,guestOpManger,
new String[]{"fileManager"}).get("fileManager");
System.out.println(fileManagerRef);
System.out.println(fileManagerRef.getType());
System.out.println(fileManagerRef.getValue());
NamePasswordAuthentication auth = new NamePasswordAuthentication();
auth.setUsername("username");
auth.setPassword("password");
auth.setInteractiveSession(false);
vimPort.validateCredentialsInGuest(fileManagerRef, var2, auth);
System.out.println("validation for guest Credentials");
List li=new ArrayList<>();
li.add("open notepad.exe");
System.out.println("Executing CreateTemporaryFile guest operation");
System.out.println("FileInitailization"+vimPort.initiateFileTransferFromGuest(fileManagerRef, var2, auth, "C:\Users\"));
vimPort.createFolder(fileManagerRef, "C:\Users\Public\dsfsfs");
String result =
vimPort.createTemporaryFileInGuest(fileManagerRef, var2, auth,"TestAfter", "BeforeTest", "C:\Users\Public");
System.out.println("Temporary file was successfully created at: "
+ result + " inside the guest");
Actual behavior
Unable to login to Guest OS and not fetching any files
Expected behavior
Login to Guest OS should happen, file directory inside Guest os should be available to perform read and write operation.
Note: I am not sure that the methods i am trying is the correct one. Please help me with correct one. Even I am not able to fetch the ip address of the VM using sdk.
The text was updated successfully, but these errors were encountered: