How Can I Enable Webcam Access Inside the Sandbox?

Discussion in 'Sandboxie (SBIE Open Source) Plus & Classic' started by johnny_castle, Aug 9, 2024.

  1. johnny_castle

    johnny_castle Registered Member

    Joined:
    May 5, 2021
    Posts:
    79
    Location:
    USA
    I've noticed that when I load my webcam on any of the big three browsers (Chrome, Firefox or Edge), I get a "Failed to allocate video source" error.

    I've tested these outside the sandbox, and can confirm they work fine. So it's definitely something about how my sandbox is set up. I've used Sandboxie with these browsers in the past, so I'm sure it's just a tweak needed. Just need to know what that would be on the latest versions. Here's more info and a screenshot:
    • Running Sandboxie-Pluys v1.14.4 on Windows 11
    • All browsers are set to "Force load in Sandbox"
    • 95% of my Sandboxie settings are left default (except for a few pertaining to which directories I want to recover files to)
    Screenshot:

    https://i.imgur.com/IXCDPbk.png
     
  2. busy

    busy Registered Member

    Joined:
    Apr 10, 2006
    Posts:
    507
  3. johnny_castle

    johnny_castle Registered Member

    Joined:
    May 5, 2021
    Posts:
    79
    Location:
    USA
    Thanks for the info. So just to make sure I understand the work around until this is resolved, let me ask a question about this (from the link above):

    "As a preliminary workaround a Compartment Type Box can be used with opened COM access can be used
    • NoSecurityIsolation=y
    • Template=OpenCOM"
    Is this something I can implement into my existing sandbox, or is it saying I have to make a new box just to use the webcam? Not sure how to set this up exactly.
     
  4. busy

    busy Registered Member

    Joined:
    Apr 10, 2006
    Posts:
    507
    First of all, I recommend that you create a new box and see if the settings work properly. Because one of the settings requires a supporter certificate for long-term use.

    Code:
    https://drive.proton.me/urls/7VAMN9P728#jjNXRULrzbyr
     
  5. johnny_castle

    johnny_castle Registered Member

    Joined:
    May 5, 2021
    Posts:
    79
    Location:
    USA
    Thanks! I tired a new box, same result. Based on the above, I have two more follow up questions...
    1. I have been using Sandboxie for years, so have no problem supporting it and receiving a support token. Can all of these settings be incorporated into my existing default sandbox (so I don't have to use multiple ones)?
    2. I primarily use Sandboxie to keep things like cookies, internet history or any of the malicious files one might come across when browsing online isolated and off my system. Will the NoSecurityIsolation=y and Template=OpenCOM settings compromise this?
     
  6. Mr.X

    Mr.X Registered Member

    Joined:
    Aug 10, 2013
    Posts:
    5,257
    Location:
    .
    Why not run a browser instance unsandoxed dedicated for webcam activities only?
     
  7. johnny_castle

    johnny_castle Registered Member

    Joined:
    May 5, 2021
    Posts:
    79
    Location:
    USA
    Yes, that is an option. But would like everything sandboxed if possible (as I've always done in the past, just to keep my sign-in and accounts from always staying cached). So how will the settings above effect that?
     
  8. busy

    busy Registered Member

    Joined:
    Apr 10, 2006
    Posts:
    507
    @johnny_castle
    1. Yes, you can incorporate all these settings into your existing sandbox, if you don't want to use multiple sandboxes.

    2. Yes, the settings NoSecurityIsolation=y and Template=OpenCOM may compromise the isolation of potentially malicious files from your system.

    NoSecurityIsolation:
    Security Isolation through the usage of a heavily restricted process token is Sandboxie's primary means of enforcing sandbox restrictions, when this is disabled the box is operated in the application compartment mode, i.e. it's no longer providing reliable security, just simple application compartmentalization.

    Template=OpenCOM:
    Don't use virtualized COM, Open access to hosts COM infrastructure (not recommended)

    If you don't mind me asking, on which sites did you get this error?
     
  9. busy

    busy Registered Member

    Joined:
    Apr 10, 2006
    Posts:
    507
    You may be able to use the webcam with Open Broadcaster Software with the following setting.

    Sandboxie-Plus > Right click on the sandbox > Sandbox Options > Edit ini Section > Add the line at the bottom > OK
    Code:
    OpenIpcPath=*\BaseNamedObjects*\OBSVirtualCamVideo

    from ChatGPT:

    Setting up your webcam through OBS (Open Broadcaster Software) and using the OBS Virtual Camera feature is a great way to add some extra flexibility and customization to your video streams. Here’s a step-by-step guide to help you through the process:

    1. Install OBS Studio
    • Download OBS Studio: Go to the OBS Project website and download the version appropriate for your operating system (Windows, macOS, or Linux).
    • Install OBS Studio: Follow the installation prompts to complete the setup.

    2. Set Up Your Webcam in OBS
    • Open OBS Studio: Launch OBS Studio after installation.
    • Create a New Scene:
      • In the “Scenes” box at the bottom left, click the “+” button to create a new scene. Give it a name if you wish.
    • Add Your Webcam:
      • In the “Sources” box next to “Scenes,” click the “+” button.
      • Select “Video Capture Device” from the list.
      • Choose your webcam from the “Device” dropdown menu.
      • Adjust settings as needed (resolution, frame rate, etc.) and click “OK.”

    3. Configure OBS Virtual Camera
    • Enable Virtual Camera:
      • Go to the top menu and select Start Virtual Camera. On Windows, it’s under Tools > Start Virtual Camera. On macOS, it’s under Start Virtual Camera directly from the main menu.
      • This option will start a virtual camera that you can use in other applications.

    4. Use OBS Virtual Camera in Other Applications
    • Open Your Desired Application: This could be Zoom, Microsoft Teams, Google Meet, or any other video conferencing tool that supports webcam input.
    • Select OBS Virtual Camera as Your Webcam:
      • Go to the video settings or preferences of your application.
      • Find the option to select a webcam and choose “OBS Virtual Camera” from the list.

    5. Adjust OBS Settings as Needed
    • Scenes and Sources: You can switch between different scenes in OBS or add additional sources (like overlays, images, or text) to customize your video feed.
    • Filters and Effects: OBS allows you to add filters and effects to your video feed for additional customization.

    Troubleshooting Tips
    • Update OBS: Ensure you’re using the latest version of OBS Studio for the best performance and compatibility.
    • Check Permissions: Make sure your webcam and microphone permissions are granted in both OBS and the application you're using.
    • Restart Applications: Sometimes restarting your video conferencing app or your computer can resolve issues with the virtual camera not appearing.

    By following these steps, you should be able to set up your webcam in OBS and use the OBS Virtual Camera feature effectively.
     
  10. johnny_castle

    johnny_castle Registered Member

    Joined:
    May 5, 2021
    Posts:
    79
    Location:
    USA
    Well...that's getting me closer! As it happens, I already had OBS installed, so I tried adding that OpenIpcPath=*\BaseNamedObjects*\OBSVirtualCamVideo to my Sandboxie config and using the OBS Virtual Cam option.

    I was able to get a brief flash of activity in the cam window on the site that was sandboxed, but it immediately goes away. It would appear the main issue is that the browser (when sandboxed) is reading that the cam source is already in use. But when not sandboxed, it doesn't do that. Is there something I'm missing there that can be tweaked further? I even tried creating a new standard box with all default settings, but the same result. Or have I reached the limitations of the current boxes, and would still need to go the support token route to disable some of those security features?

    If I could just get it to read that the cam is not in use (before I sandbox), then I'm sure it'll work.
     
  11. busy

    busy Registered Member

    Joined:
    Apr 10, 2006
    Posts:
    507
    OBS needs to run outside the sandbox.
     
  12. johnny_castle

    johnny_castle Registered Member

    Joined:
    May 5, 2021
    Posts:
    79
    Location:
    USA
    Thanks, will continue to work with it and see if I can get things working correctly. Thanks for all the help!
     
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.