Die Foren-SW läuft ohne erkennbare Probleme. Sollte doch etwas nicht funktionieren, bitte gerne hier jederzeit melden und wir kümmern uns zeitnah darum. Danke!

VMRC mit Zwischenablage

Alles zum Thema vSphere 6.5, ESXi 6.5 und vCenter Server.

Moderatoren: irix, Dayworker

Member
Beiträge: 155
Registriert: 31.01.2014, 12:08

VMRC mit Zwischenablage

Beitragvon lord_icon » 03.01.2018, 15:11

Moin,

hat jm. VMRC(VMware Remote Console) im Einsatz ?

Ich hab da 2-3 Fragen:

1: Wenn ich eine Verknüpfung mit folgenden Link erzeuge:

Code: Alles auswählen

vmrc://root@192.168.2.6/?moid=3

Dann wird eine Remote Console zur der 3ten Virtuelen Maschine erstellt.
Dort fragt er mich nach username und Kennwort.

Ich konnte das mitunter schon soweit erweitern:

Code: Alles auswählen

vmrc://root:passwort@192.168.2.6/?moid=3


Zumindest scheint mir dann der username schon mal übergeben zu werden. Das Passwort aber nicht... und auch nicht der OK Button.
Sprich: Muß erst nochmal klicken um in die VM zu kommen.
Und ja... ich brauch nicht unbedingt username+passwort übergeben, weil ich ja im Abfragefenster die Speichern-Option habe. aber as nochmalige Bestätigen erbleibt mir nicht erspart. Das wäre aber das Ziel.


2: Mittel:

Code: Alles auswählen

"C:\Program Files (x86)\VMware\VMware Remote Console\vmrc.exe" -h 192.168.2.6 -u root -p passwort "/vmfs/volumes/5a39405c-0efc0ae9-26a2-0025908f178e/TEST-System]/TEST-System.vmx"

komm ich auch nciht weiter.
Es gibt im Web aber ein paar wenige Dokus, die username + passwort in gleicher konstellation über folgenden Pfad erreichen konnten:

Code: Alles auswählen

"C:\Program Files (x86)\Common Files\VMware\VMware VMRC Plug-in\Internet Explorer\vmware-vmrc.exe"


Fraglich ist nur: Woher bekomme ich dieses Plugin.Ausserdem will ich den IE nicht nutzen. Scheint mir ja dann eine Browsersitzung zu starten. Das ist hier aber nicht gewünscht.


3: Die wichtigste Frage... selbst wenn ich mit den Bestätigen Button leben könnte... kann ich mit der fehlende Zwischenablage nicht.
Sprich: Text aus VM1 in VM2 zu übertragen scheint nicht zu klappen. Gibt es Systemeinstellungen, die zu tätigen sind ?


DAAAAAAAAnkeeeeeee ;-)

King of the Hill
Beiträge: 13561
Registriert: 01.10.2008, 12:54
Wohnort: laut USV-Log am Ende der Welt...

Re: VMRC mit Zwischenablage

Beitragvon Dayworker » 03.01.2018, 20:21

Zwecks Anmeldung schau mal bei William Lam auf virtuallyghetto.com vorbei.

Das die Zwischenablage nicht funktioniert, ist eine Sicherheitsfunktion und läßt sich sicherlich auch wieder über die üblichen Befehle aus der Workstation reaktivieren. Allerdings lassen sich solche Einstellungen nicht zur Laufzeit vornehmen, die VM muß dazu meines Wissens abgeschaltet sein.

Member
Beiträge: 155
Registriert: 31.01.2014, 12:08

Re: VMRC mit Zwischenablage

Beitragvon lord_icon » 04.01.2018, 10:34

nope. Die Seite hatte ich auch schon am Wickel... aber das einzigste was ich da gefunden habe ist das hier:

https://www.virtuallyghetto.com/2014/10/standalone-vmrc-vm-remote-console-re-introduced-in-vsphere-5-5-update-2b.html

Und da steht nur mit Username übergabe. Passwort ist nicht erwähnt

King of the Hill
Beiträge: 13561
Registriert: 01.10.2008, 12:54
Wohnort: laut USV-Log am Ende der Welt...

Re: VMRC mit Zwischenablage

Beitragvon Dayworker » 04.01.2018, 14:23

Dann schau dir mal die hier bitte an:
  • https://www.onderka.com/2013/02/26/vm-konsole-auf-esxi-per-batch-offnen/
  • http://blog.kingbytewolf.com/vmware-remote-console-vmrc/

Experte
Beiträge: 1006
Registriert: 30.10.2004, 12:41

Re: VMRC mit Zwischenablage

Beitragvon mbreidenbach » 05.01.2018, 16:12

Ich habe mir ein PowerCLI Skript gebaut welches die VMRC aufruft und da habe ich mit New-VICredentials oder wie das heißt vCenter credentials hinterlegt... über die Sicherheit davon kann man jetzt streiten aber es funktioniert. Auch mir GUI.

Nach PS2EXE läßt sich das auch z.B. in mRemoteNG als externes Programm zum Aufruf der VMRC verwenden.


Code: Alles auswählen

<#
    .SYNOPSIS
    Shows MultiListBox of connected VMs then launches VMRC for selected VMs
    .DESCRIPTION
    If not connected to a VIserver asks for VIserver name and connects
   Shows MultiListBox of connected VMs then launches VMRC for selected VMs
   .EXAMPLE
    VMRC
   .PARAMETER VM
    open console for VM; don't show selection box
    .PARAMETER VIserver
    Name of vCenter Server
   .PARAMETER AskVIServer
   Show VIServer name popup
    .PARAMETER replica
    show/ignore *_replica VMs
    .PARAMETER nea
    show/ignore Veeam Network Extension Appliance* VMs
    .NOTES
   Martin Breidenbach 2017
#>
#Requires -Modules VMware.VimAutomation.Core

param(
   [Parameter(Mandatory=$False)]
   [string]$VM,
   [Parameter(Mandatory=$False)]
   [string]$VIServer="my.vcenter.server",
   [Parameter(Mandatory=$False)]
   [boolean]$AskVIServer=$false,
   [Parameter(Mandatory=$False)]
   [boolean]$replica=$false,
   [Parameter(Mandatory=$False)]
   [boolean]$nea=$false
) #param

function Show-MultiListbox {
<#
   .SYNOPSIS
   Displays a MultiListBox
   .DESCRIPTION
   Displays a MultiListBox
   .EXAMPLE
   $SelectedVMs = Show-MultiListBox $VMs -Title1 'Run VMRC' -Title2 'Please select VMs from the list below:' -Height 300
   .PARAMETER List
   list of strings
   .PARAMETER Title1
   sets MultiListBox Title
   .PARAMETER Title2
   sets MultiListBox Text
   .PARAMETER Height
   sets MultiListBox Height
   .PARAMETER help
   calls GET-HELP
   .NOTES
   based on MultiListBox: https://technet.microsoft.com/en-us/library/ff730950.aspx
   based on https://blogs.technet.microsoft.com/heyscriptingguy/2014/08/02/weekend-scripter-fixing-powershell-gui-examples/
   modified by Martin Breidenbach 2017
#>
   Param (
      [Parameter(Mandatory=$True,Position=1)]
      [string[]]$List,
      [Parameter(Mandatory=$False)]
      [string]$Title1='MultiListBox',
      [Parameter(Mandatory=$False)]
      [string]$Title2='Please select item(s) from list:',
      [Parameter(Mandatory=$False)]
      [int]$Height=200,
      [Parameter(Mandatory=$False)]
      [switch]$help
   )
   
   process {
      if($help) {Get-Help $MyInvocation.MyCommand.Name; break}
      
      Add-Type -AssemblyName System.Windows.Forms
      Add-Type -AssemblyName System.Drawing

      # Form
      $objForm                  = New-Object System.Windows.Forms.Form
      $objForm.Text             = $Title1
      $objForm.Size             = New-Object System.Drawing.Size(300,($Height + 120))
      $objForm.StartPosition    = "CenterScreen"
      $objForm.Icon             = [system.drawing.icon]::ExtractAssociatedIcon($PSHOME + "\powershell.exe")
      $objForm.minimumSize      = New-Object System.Drawing.Size(200,160)
      
      # OK Button
      $OKButton                 = New-Object System.Windows.Forms.Button
      $OKButton.Location        = New-Object System.Drawing.Size(75,($Height + 40))
      $OKButton.Size            = New-Object System.Drawing.Size(75,23)
      $OKButton.Text            = "OK"
      $OKButton.DialogResult    = [System.Windows.Forms.DialogResult]::OK
      $objForm.AcceptButton     = $OKButton
      $objForm.Controls.Add($OKButton)

      # Cancel Button
      $CancelButton              = New-Object System.Windows.Forms.Button
      $CancelButton.Location     = New-Object System.Drawing.Size(150,($Height + 40))
      $CancelButton.Size         = New-Object System.Drawing.Size(75,23)
      $CancelButton.Text         = "Cancel"
      $CancelButton.DialogResult = [System.Windows.Forms.DialogResult]::Cancel
      $objForm.CancelButton      = $CancelButton
      $objForm.Controls.Add($CancelButton)

      # Label
      $objLabel                 = New-Object System.Windows.Forms.Label
      $objLabel.Location        = New-Object System.Drawing.Size(10,20)
      $objLabel.Size            = New-Object System.Drawing.Size(280,20)
      $objLabel.Text            = $Title2
      $objForm.Controls.Add($objLabel)

      # Listbox
      $objListbox               = New-Object System.Windows.Forms.Listbox
      $objListbox.Location      = New-Object System.Drawing.Size(10,40)
      $objListbox.Size          = New-Object System.Drawing.Size(260,$Height)
      $objListbox.SelectionMode = "MultiExtended"

      ForEach ($Item in $List) {
         [void]$objListBox.Items.Add($Item)
      }
      
      $objForm.Controls.Add($objListbox)
      $objForm.Topmost = $True
            
      $resizeHandler = {
         $objListbox.Size       = New-Object System.Drawing.Size(($objForm.Width - 40),($objForm.Height - 120))
         $OKButton.Location     = New-Object System.Drawing.Size(($objForm.Width/2-75),($objForm.Height -  80))
         $CancelButton.Location = New-Object System.Drawing.Size(($objForm.Width/2)   ,($objForm.Height -  80))
      }
      $objForm.Add_Resize($resizeHandler)
      
      # Show Form
      $objForm.Add_Shown({$objForm.Activate()})
      $Result = $objForm.ShowDialog()
      
      if ($Result -eq [System.Windows.Forms.DialogResult]::OK) {
         Return $objListBox.SelectedItems
      }
   } #process
}

function Show-InputBox {
<#
   .SYNOPSIS
   Displays a InputBox
   .DESCRIPTION
   Displays a InputBox
   .EXAMPLE
   Show-InputBox "edit me"
   .PARAMETER Text
   input string
   .PARAMETER Title1
   sets InputBox Title
   .PARAMETER Title2
   sets InputBox Text
   .NOTES
   based on https://technet.microsoft.com/en-us/library/ff730941.aspx
   based on https://blogs.technet.microsoft.com/heyscriptingguy/2014/08/02/weekend-scripter-fixing-powershell-gui-examples/
   modified by Martin Breidenbach 2017
#>
   Param (
      [Parameter(Mandatory=$True,Position=1)]
      [string]$Text,
      [Parameter(Mandatory=$False)]
      [string]$Title1='Data Entry Form',
      [Parameter(Mandatory=$False)]
      [string]$Title2='Please enter the information in the space below:'
   )
   
   process {
      Add-Type -AssemblyName System.Windows.Forms
      Add-Type -AssemblyName System.Drawing

      $objForm               = New-Object System.Windows.Forms.Form
      $objForm.Text          = $Title1
      $objForm.Size          = New-Object System.Drawing.Size(300,160)
      $objForm.StartPosition = "CenterScreen"
      $objForm.Icon          = [system.drawing.icon]::ExtractAssociatedIcon($PSHOME + "\powershell.exe")
      $objForm.minimumSize   = New-Object System.Drawing.Size(200,160)
      $objForm.maximumSize   = New-Object System.Drawing.Size(965,160)
      $objForm.MinimizeBox   = $false
      $objForm.MaximizeBox   = $false

      $OKButton              = New-Object System.Windows.Forms.Button
      $OKButton.Location     = New-Object System.Drawing.Size(75,80)
      $OKButton.Size         = New-Object System.Drawing.Size(75,23)
      $OKButton.Text         = "OK"
      $OKButton.DialogResult = [System.Windows.Forms.DialogResult]::OK
      $objForm.AcceptButton  = $OKButton
      $objForm.Controls.Add($OKButton)

      $CancelButton              = New-Object System.Windows.Forms.Button
      $CancelButton.Location     = New-Object System.Drawing.Size(150,80)
      $CancelButton.Size         = New-Object System.Drawing.Size(75,23)
      $CancelButton.Text         = "Cancel"
      $CancelButton.DialogResult = [System.Windows.Forms.DialogResult]::Cancel
      $objForm.CancelButton      = $CancelButton
      $objForm.Controls.Add($CancelButton)

      $objLabel          = New-Object System.Windows.Forms.Label
      $objLabel.Location = New-Object System.Drawing.Size(10,20)
      $objLabel.Size     = New-Object System.Drawing.Size(280,20)
      $objLabel.Text     = $Title2
      $objForm.Controls.Add($objLabel)

      $objTextBox          = New-Object System.Windows.Forms.TextBox
      $objTextBox.Location = New-Object System.Drawing.Size(10,40)
      $objTextBox.Size     = New-Object System.Drawing.Size(260,20)
      $objTextBox.Text     = $Text
      $objForm.Controls.Add($objTextBox)

      $objForm.Topmost = $True

      $resizeHandler = {
         $objTextBox.Size       = New-Object System.Drawing.Size(($objForm.Width - 40),20)
         $OKButton.Location     = New-Object System.Drawing.Size(($objForm.Width/2-75),($objForm.Height - 80))
         $CancelButton.Location = New-Object System.Drawing.Size(($objForm.Width/2)   ,($objForm.Height - 80))
      }
      $objForm.Add_Resize($resizeHandler)
            
      $objForm.Add_Shown({$objForm.Activate()})
      $Result = $objForm.ShowDialog()
      if ($Result -eq [System.Windows.Forms.DialogResult]::OK) {
         Return $objTextBox.Text
      }
   } #process
}

function Show-MessageBox {
<#
   .SYNOPSIS
   Displays a MessageBox
   .DESCRIPTION
   Displays a MessageBox
   .EXAMPLE
   Show-MessageBox -Title 'WARNING' -Message 'There was an error'
   .PARAMETER Title
   sets MessageBox Title
   .PARAMETER Message
   sets MessageBox Text
   .NOTES
   based on https://technet.microsoft.com/en-us/library/ff730941.aspx
   based on https://blogs.technet.microsoft.com/heyscriptingguy/2014/08/02/weekend-scripter-fixing-powershell-gui-examples/
   modified by Martin Breidenbach 2017
#>
   Param (
      [Parameter(Mandatory=$True,Position=1)]
      [string]$Title='Message',
      [Parameter(Mandatory=$False)]
      [string]$Message='This is the message!'
   )
   
   process {
      Add-Type -AssemblyName System.Windows.Forms
      Add-Type -AssemblyName System.Drawing
      
      $width = [math]::max($Title.Length,$Message.Length)*6
      
      $objForm               = New-Object System.Windows.Forms.Form
      $objForm.Text          = $Title
      $objForm.Size          = New-Object System.Drawing.Size(($width+40),130)
      $objForm.StartPosition = "CenterScreen"
      $objForm.Icon          = [system.drawing.icon]::ExtractAssociatedIcon($PSHOME + "\powershell.exe")
      $objForm.minimumSize   = New-Object System.Drawing.Size(100,130)
      $objForm.maximumSize   = New-Object System.Drawing.Size(900,130)
      $objForm.MinimizeBox   = $false
      $objForm.MaximizeBox   = $false

      $objForm.KeyPreview = $True
      $objForm.Add_KeyDown({if ($_.KeyCode -eq "Enter") {$objForm.Close()}})
      $objForm.Add_KeyDown({if ($_.KeyCode -eq "Escape") {$objForm.Close()}})

      $OKButton              = New-Object System.Windows.Forms.Button
      $OKButton.Location     = New-Object System.Drawing.Size($objForm.Width/2-50),($objForm.Height - 80)
      $OKButton.Size         = New-Object System.Drawing.Size(75,23)
      $OKButton.Text         = "OK"
      $OKButton.DialogResult = [System.Windows.Forms.DialogResult]::OK
      $objForm.AcceptButton  = $OKButton
      $objForm.Controls.Add($OKButton)

      $objLabel          = New-Object System.Windows.Forms.Label
      $objLabel.Location = New-Object System.Drawing.Size(10,20)
      $objLabel.Size     = New-Object System.Drawing.Size($width,20)
      $objLabel.Text     = $Message
      $objForm.Controls.Add($objLabel)

      $objForm.Topmost = $True

      $resizeHandler = {
         $OKButton.Location = New-Object System.Drawing.Size(($objForm.Width/2-50),($objForm.Height - 80))
      }
      $objForm.Add_Resize($resizeHandler)
            
      $objForm.Add_Shown({$objForm.Activate()})
      [void] $objForm.ShowDialog()
   } #process
}


# Check that we are connected to a VIServer
if (-not $global:DefaultVIServers) {
   if ($AskVIServer) {$VIServer = Show-InputBox $VIServer -Title1 "Run VMRC" -Title2 "Enter vCenter Server:"}
   if ($VIServer) {Connect-VIServer $VIServer}
   if (-not $global:DefaultVIServers) {Show-MessageBox -Title 'Warning:' -Message 'VMRC: You are not connected to any VIServer'; break}
}   
# Get sorted list of connected VM names

if ($VM) {
   $Exists = Get-VM -name $VM -ErrorAction SilentlyContinue
   if ($Exists) {
      $SelectedVMs = $VM
   } else {
      Show-MessageBox -Title 'Warning:' -Message "VMRC: VM $VM not found"; break
   }
} else {
   $VMs = (Get-VM | Where-Object{$_.ExtensionData.Runtime.ConnectionState -eq 'connected'}).Name | Sort-Object
   if (-not $replica) {$VMs = ($VMs | where-object {-not($_ -like '*_replica')})}
   if (-not $nea)     {$VMs = ($VMs | where-object {-not($_ -like 'Network Extension Appliance*')})}

   # select VMs
   $SelectedVMs = Show-MultiListBox $VMs -Title1 'Run VMRC' -Title2 'Please select VMs from the list below:' -Height 300
}

# run VMRC for selected VMs
if ($SelectedVMs) {
   ForEach ($VM in $SelectedVMs) {Open-VMConsoleWindow(Get-VM($VM))}
} else {
   Show-MessageBox -Title 'Warning:' -Message 'VMRC: No VMs have been selected.'; break
}


Zurück zu „vSphere 6.5“

Wer ist online?

Mitglieder in diesem Forum: 0 Mitglieder und 10 Gäste