
- Replace bind-mounts on /lmn/media/$USER with separate mounting for Home and Share SMB shares in the VM. - Update vm-run to start virtiofsd with /lmn/media/$USER (/home/$USER on localhome machines). - Use vm-vminfo to generate a JSON file containing user information, including Username, Groups, printer list krb5-ticket and some more - Configure vminfo.service (systemd-timer) to periodically call vm-vminfo. - Ensure krb5-ticket (TGT) is injected into the Windows VM. - Mount SMB-Home and SMB-Share shares as part of the new structure.
30 lines
747 B
PowerShell
30 lines
747 B
PowerShell
# Injects krb5-credential from .vminfo.json if available
|
|
# 02.07.2025 da
|
|
|
|
function Import-VMInfo {
|
|
param (
|
|
[string]$Path
|
|
)
|
|
|
|
if (Test-Path $Path) {
|
|
return Get-Content -Path $Path -Raw | ConvertFrom-Json
|
|
} else {
|
|
Write-Error "Fehler beim Einlesen der VMInfo Datei ($Path nicht gefunden)."
|
|
Write-Error "Tipp: Beim Neustart der VM wird diese Datei neu angelegt."
|
|
Pause
|
|
exit
|
|
}
|
|
}
|
|
|
|
$VMInfoPath = "Y:\.vminfo.json"
|
|
|
|
# Schleife, die auf das Laufwerk wartet
|
|
if (-not (Test-Path $VMInfoPath)) {
|
|
Write-Host "$VMInfoPath nicht gefunden. Skript beenden."
|
|
exit
|
|
}
|
|
|
|
# VMInfo aus JSON File einlesen
|
|
$VMInfo = Import-VMInfo -Path $VMInfoPath
|
|
|
|
& $PSScriptRoot\injector.ps1 $VMInfo.krb5.cred
|