Let $\langle x_{n} \mid n \in \mathbb{N}\rangle$ be a dense sequence of the unit sphere of $X$. Notice that $\varphi \in B'$ if and only if $|\varphi(x_n)| \leq 1$ for all $n$.
Choose a continuous function $f \colon \mathbb{R} \to [0,1]$ such that $f(t) = 0$ for $0 \leq |t| \leq 1$ and $0 \lt f(t) \leq 1$ for all $|t| \gt 1$, e.g. $f(t) = \min\{1,\max\{|t|-1,0\}\}$.
Now define
$$g(\varphi) = \sum_{n=1}^\infty 2^{-n} f(\varphi(x_n)).$$ Then $g\colon X' \to [0,1]$ is weak*-continuous and $g(\varphi) \gt 0$ if and only if there is $x_n$ such that $|\varphi(x_n)| \gt 1$ if and only if $\varphi \notin B'$.