I'm having an issue with running some automation code on a vm my host is my Mac and I've opened an ubuntu 22.04.3 vm. I'm using robotjs as the package to move the mouse on screen. when I run the code on my host (Mac) the mouse moves and everything is fine. when im trying to run the same code on the vm it looks like the cursor wants to move (it does a little wiggle) but stays at the same place instead of moving and clicking on the correct locations on the screen and filling some text. At this point I'm desperate, I've tried everything, tried changing packages from robotjs to iohook , still the same, looked at every configuration in my mac and the vm and nothing seem to change that behavior. it even looks from logs that it can locate the correct place that the mouse should go to and even does other actions like clicking , scrolling etc. but the only missed motion is the mouse movement itself and I cant solve it.
any savior in this world ? It feels like the only option I have left to do is to try and create the same thing on Windows and hope for the best but I don't want to go that route.
for testing purposes you can use this block of code i guess just to make sure the mouse moves:
const puppeteer = require('puppeteer');
const robot = require('robotjs');
async function runTest() {
const browser = await puppeteer.launch({ headless: false });
const page = await browser.newPage();
await page.goto('https://example.com');
robot.moveMouse(100, 100);
robot.moveMouse(200, 100);
robot.moveMouse(300, 100);
robot.moveMouse(400, 400);
await browser.close();
}
runTest();
I've created something simple just for testing you can add delay between movements if you need.
Update: the code and configuration works on windows vm. So I guess it's narrowed the issue to Ubuntu.