Jump to content


How to access command line on my VPS?


  • Please log in to reply
11 replies to this topic

#1 insertmesh

insertmesh

    Advanced Member

  • Members
  • PipPipPip
  • 35 posts

Posted 12 July 2020 - 01:01 PM

This is such an incredibly nooby questions, but unfortunately I AM an incredible noob when it comes to this stuff...

So, I managed to set up perforce on a VPS I recently started renting.
As I know nothing about Linux, I had to follow a step by step tutorial:

https://allarsblog.c...<br /> <br /> this worked just find and I was set up within minutes.

I could also connect to that server using the P4V Visual client and start adding stuff to the depot etc.

For some specific actions, like adding a p4 typemap, I will probably still have to use command line, but I can´t figure out how to do this on the VPS.

Connecting to the VPS via putty and then just typing in "p4 typemap" just gives me an error "p4: command not found".

Am I missing a step in the above mentioned blog, to gett access to those commandline commands?
Or do I need to change directory, after connecting as "root"?

#2 Sambwise

Sambwise

    Advanced Member

  • Members
  • PipPipPip
  • 1149 posts

Posted 12 July 2020 - 02:56 PM

To use client commands from the command line, you don't need to actually be logged in to the VPS.  Just install the p4 command line on your local machine (the same one you're using P4V on).  Perforce is client/server software; the whole point is that you can use it from anywhere as long as you have a network connection.  :)

#3 insertmesh

insertmesh

    Advanced Member

  • Members
  • PipPipPip
  • 35 posts

Posted 12 July 2020 - 04:57 PM

I see. Ok, then I´m still doing something wrong...
I already tried that.
Windows+r, cmd, type in some command like p4 typemap.
I immediately get an error saying

Perforce client error:
Connect to server failed, ceck $p4port.

As this worked before I installed the remote VPS server, when I was just connecting to localhost:1666, I wonder what I have to do differently now.

I´m checking the docs again, but I didn´t have luck yet.

#4 Sambwise

Sambwise

    Advanced Member

  • Members
  • PipPipPip
  • 1149 posts

Posted 12 July 2020 - 05:18 PM

Set P4PORT:

p4 set p4port=your.vps.host:1666

but replace your.vps.host:1666 with the right value.  (Same server port you use to connect with P4V.)

You may also need to do:

p4 set p4user=your.user.name
p4 set p4client=your.workspace.name

p4 set is persistent so you'll only need to do this once.

#5 insertmesh

insertmesh

    Advanced Member

  • Members
  • PipPipPip
  • 35 posts

Posted 12 July 2020 - 05:29 PM

Still getting an error:

Perforce client error:
Connect to server failed; check $P4PORT.
Execution Failed: p4d.exe -i -J off -r "c:Users\samue\.p4root": The system cannot find the file specified

#6 Sambwise

Sambwise

    Advanced Member

  • Members
  • PipPipPip
  • 1149 posts

Posted 12 July 2020 - 06:04 PM

That's a P4PORT string for a local server.  You need to use the same P4PORT that you're using to connect to your VPS from P4V -- it should have the hostname or IP of your VPS, followed by :1666.

If you aren't using a string like that to connect from P4V, P4V isn't actually connected to your VPS...

#7 insertmesh

insertmesh

    Advanced Member

  • Members
  • PipPipPip
  • 35 posts

Posted 12 July 2020 - 06:30 PM

I´m definitely connected to the VPS server via P4V.
I also just found something weird:
If I go to the P4V and right click on the depot, I have an option to "open commandline here".
If I click on that, I get a commandline in that workspace directory (C:Perforce/Project) and...
If I type in p4 commands here, it actually works!

So, I reopend the commandline from windows, using "Windows+r", typing in "cmd".

Apparently I was in the path of "C:\Users\myusername"

So I went up to the windows root folder, by typing in "cd \"
And now, if I type in any p4 commands...it actually works...
Does that make sense, or do you think I´m not connected?
How can I check for that?

#8 Sambwise

Sambwise

    Advanced Member

  • Members
  • PipPipPip
  • 1149 posts

Posted 12 July 2020 - 06:44 PM

Ah -- maybe the earlier time you were in the directory for a local server, and so its P4CONFIG was being applied.  If you run p4 set by itself it'll show you what your current settings are:

C:\Perforce\test>p4 set
P4CHARSET=none (config 'c:\Perforce\test\p4config.txt')
P4CLIENT=Samwise-dvcs-1509687817 (config 'c:\Perforce\test\p4config.txt')
P4CONFIG=p4config.txt (set) (config 'c:\Perforce\test\p4config.txt' )
P4EDITOR=notepad (set)
P4IGNORE=p4ignore.txt (config 'c:\Perforce\test\p4config.txt')
P4INITROOT=c:\Perforce\test (config 'c:\Perforce\test\p4config.txt')
P4MERGE=vsmerge.bat (set)
P4PORT=rsh:p4d.exe -i -J off -r "c:\Perforce\test\.p4root" (config 'c:\Perforce\test\p4config.txt')
P4USER=Samwise (config 'c:\Perforce\test\p4config.txt')

Most of the settings here are coming from a P4CONFIG file that's in the working directory.  If I go to a directory where there's no P4CONFIG file then I just get the values that I've set with "p4 set":

C:\>p4 set
P4CONFIG=p4config.txt (set) (config 'noconfig')
P4EDITOR=notepad (set)
P4MERGE=vsmerge.bat (set)
P4PORT=1777 (set)
P4USER=bob (set)
P4_1777_CHARSET=none (set)


#9 insertmesh

insertmesh

    Advanced Member

  • Members
  • PipPipPip
  • 35 posts

Posted 12 July 2020 - 06:54 PM

Yes, that seems like exactly what was going on here.
Since I first installed p4V to test it out locally, I guess the settings where still in the system.
So, using "p4 set" in the local user directory, I get the local stuff, which isn´t working anymore.

If I use "p4 set" in the C root directory, I get all the data like my vps ip etc.

#10 insertmesh

insertmesh

    Advanced Member

  • Members
  • PipPipPip
  • 35 posts

Posted 12 July 2020 - 06:55 PM

So...I´m still a bit uncertain...should I still try and uninstall everything on my local workstation and do a clean install of it, or is it enough that I just change directory, when I want to work with command line? I mean, the vps seems to be running, or can I test that somehow?

#11 Sambwise

Sambwise

    Advanced Member

  • Members
  • PipPipPip
  • 1149 posts

Posted 12 July 2020 - 07:00 PM

Just delete all the stuff from the local server, including its old P4CONFIG file (the one whose path is displayed when you run "p4 set" in that directory).  Uninstalling won't actually fix anything because the uninstaller doesn't delete any local data.  Once you delete the P4CONFIG file then it won't override your P4PORT setting any more and it won't matter what directory you're in.

Test that the VPS is running with the "p4 info" command.  That asks the server to send you information about itself and about how you're connected to it -- if the server isn't running, you'll get a connection error.

C:\Perforce\workshop>p4 info
User name: sam_stafford
Client name: samwise-compy386
Client host: COMPY386
Client root: c:\Perforce\workshop
Current directory: c:\Perforce\workshop
Peer address: 52.119.114.217:62670
Client address: 52.119.114.217
Server date: 2020/07/12 12:00:56 -0700 PDT
Server version: P4D/LINUX26X86_64/2020.1/1953492 (2020/04/24)
ServerID: guru_master
Server services: standard
Server license: Licensed
Case Handling: sensitive


#12 insertmesh

insertmesh

    Advanced Member

  • Members
  • PipPipPip
  • 35 posts

Posted 12 July 2020 - 07:06 PM

Ok, sweet. Seems like its connected then, I´ll delete all the local data too and be a happy fox.
Thanks again, if I can do anything for you apart from taking up your time, please let me know...:)
I mean, I like being helpful in the areas I´m good at, but you probably don´t wanna learn particle dynamics in 3ds max...:)




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users