Sixaxis emulator in a Virtual Machine

I recently was asked about running the sixaxis emulator in a VM (Virtual Machine).

As the sixaxis emulator is not designed to work in any other OS than Linux (mainly because the bluetooth stack is not as open in other OSes), running the sixaxis emulator in a VM could be a work-around for people that can’t (or don’t want to) install Linux on their machine.

With Windows Vista running VirtualBox/Ubuntu, I tried to perform the Sixaxis emulator tutorial.

Only step 1 doesn’t work: it seems the usb connection with the sixaxis doesn’t work as expected.

This is not a big issue since step 1 can be done once and for all with a livecd on any pc.

The only thing to care about is to disconnect usb devices from the VirtualBox before unplugging them.

With VirtualBox+Ubuntu, I get too much lag with the mouse, so that it can’t be used to play. I’m going to test other VMs.

18 Replies to “Sixaxis emulator in a Virtual Machine”

  1. Great idea!

    I think this is possible 🙂

    Examples of head tracking systems and voice recognition are available on the web.

    I'll try to investigate on that asap!

  2. Thanks for pointing out that "portable" ubuntu, I didn't know about that.

    It seems it will not work "as is", because the sixaxis emulator needs to access some hardware (at least the bluetooth dongle). I got no device with the lsusb command…

  3. Neither did i, and i got an error while executing the ./sixaddr code, it didn't know a function or some sort.
    But i'm trying to figure out how to direct some hardware used by windows to pubuntu, so lsusb can read it.

  4. Pubuntu is based on colinux.

    It seems the hardware that can be accessed with colinux is the memory, the cpu, and virtual devices (network interfaces, video cards, sound cards, block devices…). See there.

    There is no official support for usb devices in colinux. But there still is a little chance for that solution to work…

    A usb sharing system could allow to do the trick: the server runs on windows, and the client in colinux, so that the client accesses the usb devices of the server.

    I found usbip, but unfortunately there is no server for windows 🙁

    Thanks for your idea, it made me discover colinux 🙂

  5. I first tried it with colinux, but i couldn't set it up, that's why i use Pubuntu, easy to setup, add programs, etc…

    And you're welcome ^^

  6. Interesting…

    I actually have another idea: we don't need to run the emuclient process (which grabs events from input devices) in the virtual machine. What's preventing us to run the emu process in windows is that the l2cap layer of the bluetooth stack can't be accessed in windows (it seems freebt could be a solution, but this project seems to be dead).

    So, we only need to install a small linux distro in virtualbox, and we don't need X at all (a console is enough). A good point is that it will take less resources.

    In this virtual machine runs the emu process, that accesses the bt dongle.

    The only thing to do is to rewrite the socket layer of the emuclient process (translate berkeley sockets to winsocks), and to recompile the process for windows (+change sockets to tcp sockets).

    That shouldn't be too hard, I'm probably going to try that this week.

  7. In windows vista, I managed to get the emu process running in a virtual machine (running the slitaz distro) and the emuclient process running as a native windows application.

    Next step: get the emuclient connect and send data to the emu.

  8. Bonne chance avec ^^
    in the meantime i'm waiting for my CSR dongle, can't wait to try it out on my xubuntu laptop;

    what's also interesting is wubi, it allows the installation of xubuntu inside the windows partition, and can easily be removed in windows, that's what i currently use.

  9. Just tried running this with VMWare with UBUNTU 10.04. Apparently there is a conflict with the SDL… SDL_WM_GrabInput() and SDL_ShowCursor() don't respond the same way as in a desktop.

  10. All the steps works just fine. The only problem is with the aforementioned functions. The good thing about VMWare is that there is no virtualization of the USB. So you can either use the USB plugged to the Host machine OR the Guest. If you choose the guest it will actually recognize it as if it were plugged directly there.

  11. There is one more thing. About some broadcom usb bluetooth dongles, some of them will apparently not work when you unplug and plug again after using "bdaddr". This command is recommended instead of unplugging and plugging again: "hciconfig hci0 reset". This will work just fine and change the MAC Address but if you unplug, the original MAC will return.

  12. Thanks for the feedback.

    If you want you can try the stuff detailed at the end of this post. It consists in running the emuclient (the process that uses the SDL) in the windows host, and the emu process in the VM linux guest.

Leave a Reply

Your email address will not be published. Required fields are marked *