Coder Social home page Coder Social logo

ps-remoting's People

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar

ps-remoting's Issues

Updates Requested

I was looking for ways to remote into a Windows Sandbox VM, and found this.

I tried Enable-PSRemoting within the sandbox, and got the following error:

image

I then ran Get-NetConnectionProfile | Set-NetConnectionProfile -NetworkCategory Private, though there may be a configuration possible in the Sandbox definition to address this, and then Enable-PSRemoting -Force. You could also use -SkipNetworkProfileCheck, of course.

After this, running Invoke-Command (or Enter-PSSession) against the machine worked (on my box, at least).

image

I suspect that you may need to add something to your trusted hosts, such that you can authenticate. Have a look at something like this.

The credential you should use is provided to the WindowsSandboxClient as process arguments (and I haven't yet figured out how to run Sandbox headlessly) - you can retrieve it by viewing the process in procexp.exe (or task manager), or with PowerShell, as below:

if ((Get-Process WindowsSandboxClient).CommandLine -match "<AccountUser>(?<User>.+)</AccountUser><AccountPassword>(?<Password>.+?)</") {
$Credential = [PSCredential]::new(
    $Matches.User,
    ($Matches.Password | ConvertTo-SecureString -AsPlainText -Force)
)
} else {Write-Error "Didn't find a match"}

Unless folk change the disk image being used for the sandbox, it's unlikely to ever use a different username, but may as well grab it out!

The only problem remaining, then, is getting the machine name or connection address out. Connecting to the container ID specified in the arguments passed to WindowsSandboxClient doesn't work (but would have solved a lot of problems). I suspect it's not being treated like that sort of container.
We could mount a directory, and have the init commands for the Sandbox write a file to that location, but there should be a better way!

Sorry if you'd already solved all of this! I'd be interested to hear if you're already past all of this, or if there were any updates for this repository.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.