How to use usbhostfs_pc as non-root
I had some problems on Ubuntu with running usbhostfs_pc as non-root. I searched for an answer and finally came across a solution.
1. First go to System->Administration->Users and Groups, type in your root password and you should get to a screen with all of your users. Now click on the ‘Manage Groups‘ button and then on the ‘Add Group‘ button. Type ‘psplink‘ in the Group name section and select your user in the Group Members section. Click on Ok and then twice on Close. Now you have to logoff and log back in for your user to be added to the new group. You can also do this with terminalcommands but quite frankly I forgot how the commands work (since I don’t add groups and users on a regular basis) and I was too lazy to find out how they work again, so that’s why I chose the GUI-approach.
2. Start psplink on your PSP and plug the usb cable in. Type this command in the terminal :
lsusb
Now you should see something like this:
Bus 005 Device 005: ID 054c:01c9 Sony Corp.
Bus 005 Device 003: ID 0c45:624f Microdia
Bus 005 Device 001: ID 0000:0000
Bus 001 Device 001: ID 0000:0000
Bus 004 Device 001: ID 0000:0000
Bus 002 Device 004: ID 046d:c019 Logitech, Inc.
Bus 002 Device 001: ID 0000:0000
Bus 003 Device 004: ID 08ff:2580 AuthenTec, Inc.
Bus 003 Device 001: ID 0000:0000
3. Find the line with Sony Corp. in it and write down the two hexidecimal numbers in front of it. In my case it’s 054c and 01c9. The first number is the vendor id and is the same for all PSP’s and the second number is the product id, which is hardcoded in usbhostfs_pc so it should be the same for everybody. There is a way to change the product id by either changing it in the sourcecode and recompiling it or by supplying the wanted product id in the psplink.ini file on your PSP. Here’s how mine looks like:
# Example psplink configuration file.
# pid=num Set the product ID for hostfs allows you to use multiple PSPs at one time
# Must specify the PID using the -p option of usbhostfs_pc
# pid=0×1C9# pluser=[0 1] Enable the PSPLink user module
pluser=0# resetonexit=[0 1] Specify wheher to reset psplink when sceKernelExitGame
# is called
resetonexit=1
So if you wanted to change the product id (because you have more than 1 PSP for example) you would remove the ‘#‘ in front of the pid=0×1C9 line and change the hexidecimal number.
4. Now you need to create a rules file in /etc/udev/rules.d/ so type:
cd /etc/udev/rules.d
gksudo gedit 96-psplink.rules
Now edit this file to look like this:
SUBSYSTEM!=”usb_device”, GOTO=”psp_rules_end”
SYSFS{idVendor}==”054c”, SYSFS{idProduct}==”01c9″, GROUP=”psplink”, MODE=”0664″
LABEL=”psp_rules_end”
Pay attention here, you see the idVendor and idProduct tags in the second line? Replace the hexidecimal codes you got form the lsusb command with your own. If you have more than 1 PSP you could create more files like “96-psplink2.rules” for your second PSP. Save the file(s) and disconnect your psp.
5. Now open up a terminal, connect your psp and type:
usbhostfs_pc
Or if you have changed your product id:
usbhostfs_pc -p <value>
And it should say “Connected to device”. If not, then type this:
sudo udevcontrol reload_rules
If it still doesn’t work then read the instructions carefully and check if you have made an error and if it still doesn’t work you can send me and email.
easier & working : (found in psplinv3.0 doc)
“On unix like systems the application will need to be
run as root so that libusb can access the USB bus, the recommended way of doing this is change the
executable to be owned by root and then set the SUID bit (e.g. chown root:root usbhostfs_pc;
chmod +s usbhostfs_pc) usbhostfs_pc will drop permissions when they are not needed, it also
means that any files you create will be owned by you and not root.”
@laurent debricon
Thanks for your comment. I haven’t tried what you suggested as I don’t use Ubuntu for PSP development anymore, but I’m sure there are other people who could benefit from it